View Full Version : Form problems
ecnarongi
07-16-2002, 06:05 PM
I am trying to pass the data of one form inside hidden tags of another like so:
<input type="hidden" name="val" value="+ document.anotherformsname.formelement.value+">
but this isn't working. I remember I answered this on the old forum but when I searched for it I got nothing :(
all help is apperciated, thanks.
premshree
07-16-2002, 06:13 PM
Try this:
<input type="hidden" name="val" value="document.anotherformsname.formelement.value">
The value will be passed on. Why use the '+' sign ?
tamienne
07-16-2002, 06:15 PM
function updateInfo(newVal) {
document.form2.hiddenfield.value = newVal;
}
<FORM NAME="form1">
<INPUT TYPE="TEXT" NAME="visiblefield" VALUE="" onChange="updateInfo(this.value)">
</FORM>
<FORM NAME="form2">
<INPUT TYPE="HIDDEN" NAME="hiddenfield" VALUE="">
</FORM>
ecnarongi
07-16-2002, 06:49 PM
Originally posted by premshree
Try this:
<input type="hidden" name="val" value="document.anotherformsname.formelement.value">
The value will be passed on. Why use the '+' sign ?
this passes the string instead of the value. I will try tamienne's solution it looks to be a fix. Thanks to you both
ecnarongi
07-16-2002, 07:09 PM
that's still not a fix because sometimes the values are populated and don't change. so I am still lost...
tamienne
07-16-2002, 07:23 PM
then call it onSubmit on the form versus onChange on the text box
ecnarongi
07-16-2002, 07:23 PM
I figured it out. :cool:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.