![]() |
|
#1
|
|||
|
|||
|
Is there a way to seperate each element of a form by its own character on a preview and also leave out the trailing character?
Right now I have a form like this. [code:396ob24ixb] <form name="form1"> <input name="name" type="text" value="" length="30"> <input name="password" type="text" value="" length="30"> <input name="name1" type="text" value="" length="30"> <input name="password1" type="text" value="" length="30"> <input type="button" onclick="previewForm('form1')" value="preview"> </form> <div id="formPreview"></div> <script type="text/javascript"> function previewForm ( formName ) { for ( i = 0; i < (document.forms[formName].elements.length - 1); i++) { // -1 to remove button from loop formPreview.innerHTML += document.forms[formName].elements[i:396ob24ixb].value + " - "; } } </script> [/code:396ob24ixb] It displays the result like: Name - Password - Name1 - Password1 - and I would like it to display like: Name : password Name1 - Password1 Any ideas? |
|
#2
|
|||
|
|||
|
I would also like the ability to exclude one of the fields.
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|