raman Posted December 25, 2008 Share Posted December 25, 2008 I have a form in which I have a textbox. I want that for a new use there should be a link on the form that would allow him to load or sample data to see a demonstration of how to use the form. This can be done using the onclick event. can someone provide a script for this.This is the sample data,I will like to give. >seq1 LLKKKKKKKKKKKK >seq2 NLMMMMMMMMM This is the part of the code. <tr><td colspan=2>Enter or Paste a set of Sequences in any supported format<br>All sequences must be in the same format :</td></tr> <tr> <td colspan=2> <textarea cols="75" rows="8" name="seq"> </textarea> </td> </tr> Quote Link to comment Share on other sites More sharing options...
hobeau Posted December 27, 2008 Share Posted December 27, 2008 This is a javascript help forum. I don't think you'll find alot of people who will write your code for you. Quote Link to comment Share on other sites More sharing options...
Mikedean Posted December 27, 2008 Share Posted December 27, 2008 Try using the 'alt' tag of the elements you want to have sample data for. <script type="text/javascript"> function loadSamples() { for( var i = 0; i <= document.forms[ "blah" ].elements.length; i++ ) { if( document.forms[ "blah" ].elements[ i ].alt ) document.forms[ "blah" ].elements[ i ].value = document.forms[ "blah" ].elements[ i ].alt; } } </script> <form name="blah"> <input type="text" alt="Sample1" /> <input type="text" alt="Sample2" /> <input type="button" onClick="loadSamples(); return false;" value="Load Samples" /> </form> 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.