[Javascript] Dynamically create & populate a hidden form field...

Peter-Paul Koch gassinaumasis at hotmail.com
Thu Aug 1 05:07:25 CDT 2002


>I understand your changes to the function, but it doesn't get rid of the
>need to define the hidden field in the html, which is the goal.

The problem is that HTML works this way. If you want to send a name/value 
pair to the server and you don't want the user to see it, you use a hidden 
field.

What you want can theoretically be done, but it's difficult. You can 
dynamically generate the input field through the W3C DOM (see 
http://www.xs4all.nl/~ppk/js/booktest.html for an example), but this will 
only work in the highest browsers (IE5+, NN6+). Besides there are some bugs 
even in these browsers.

So if you don't mind restricting yourself to the highest browsers, use the 
W3C DOM. If you do mind, use hidden fields.

ppk

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the Javascript mailing list