[Javascript] Creating form object properties on the fly

DEV dev at qroute.net
Mon Jan 12 14:11:36 CST 2004


I understand that form objects can be tagged by creating properties that can
be created on the fly such as

onSubmit="this.FirstName.optional=true;this.Age.min=13;this.Age.max=75 and
so on.

I have notived thart when setting these properties such as this.Age.min=13
everything is fine as long as the value is not a string.

For example I cannot say something like
this.Zip.regexp="ZIP"

That creates an error.

Is there a way to trick so that I can assign strings to them as well.

I am writing a script that goers through all the form objects onSubmit time
to apply on the fly validation. I cannot pass thru this limitation.





More information about the Javascript mailing list