Training in Javascript

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

I know this isn't the place to post it but I don't know where to post it.

Can anybody suggest any good JavaScript classes; either on-line or in
Boston/NYC areas ?

Thanks.

J.
 
Mark Rae said:


I'll look for it too. In the meantime, I'm wrestling with what must be a
very basic question. I have this script, it works fine, that copies what's
passed to it to the Clipboard:

<script type="text/javascript">
function copytoClipBoard(rSource)
{
if(rSource!= "")
window.clipboardData.setData("Text",rSource);
}
</script>



I can call it fine like this, passing a hardcoded value:

<img src="head.jpg" onclick="copytoClipBoard('hiThere')" alt="zzz" />


But how do I call the script from a button_click event, passing it some
string value? Thanks
 
But how do I call the script from a button_click event, passing it some
string value? Thanks

<input type="button" value="Copy" onclick="copytoClipBoard('James');" />
 
Mark Rae said:
<input type="button" value="Copy" onclick="copytoClipBoard('James');" />

Thanks, that works too with a hardcoded string value. But how do I pass a
dynamic string value (i.e., label1.text) to the script? thanks much
 
Thanks, that works too with a hardcoded string value. But how do I pass a
dynamic string value (i.e., label1.text) to the script? thanks much

<input type="text" id="txtTextBox" />
<input type="button" value="Copy"
onclick="copytoClipBoard(document.getElementById('txtTextBox').value);" />
 
<input type="text" id="txtTextBox" />
<input type="button" value="Copy"
onclick="copytoClipBoard(document.getElementById('txtTextBox').value);" />

Perfect! Thanks again.
 
Back
Top