wagga2650 Posted September 6, 2009 Share Posted September 6, 2009 I have a javascript that copies from an input field straight to the page. Currently it only works on text boxes but I was wondering if anyone can get it to work with a radio box and check box. Just input data in the first field then click on the page and you will see it work. Here is the script This is the contents of a external file called copydata.js function copyData(el) { document.getElementById('copy_' + el.id).innerHTML = el.value; } This goes in the head section <script type="text/javascript" src="copydata.js"></script> and this is the body section it has 2 parts on is the input and the other is where it places the data Part 1 Name: <input type="text" name="name" style="width:250px; font-family: Verdana; font-size: 11px" id="name" onchange="copyData(this);"> Part 2 <b>Name: </b> <br> <TEXTAREA name="name" COLS=30 ROWS=1 id="copy_name" style="border: none; border-color: black; background-color: white; overflow: auto; font-family: Verdana; font-size: 11px" readonly="readonly"></TEXTAREA> Thanks in advance Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.