DHTML Forum  

Go Back   DHTML Forum > dhtmlcentral.com > DHTML Scripts
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03.02.2006, 19:59
cbr cbr is offline
Neuer Benutzer
 
Join Date: 03.02.2006
Location:
Posts: 2
Default

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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 03.02.2006, 20:06
cbr cbr is offline
Neuer Benutzer
 
Join Date: 03.02.2006
Location:
Posts: 2
Default

I would also like the ability to exclude one of the fields.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT +2. The time now is 08:27.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.