[Javascript] Creating form object properties on the fly

Chris Tifer christ at saeweb.com
Mon Jan 12 14:20:06 CST 2004


Well, I'm a little confused by your question, but one thing stands out to
me.

If your onSubmit is like this:

onSubmit="this.FirstName="test"", then that would obviously error out since
you can't have the "" nested inside of another "".

What if you tried something like:

onSubmit="this.FirstName='test'"

Also, wouldn't this require creating your own objects as it will tell you
that property doesn't exist?

Chris Tifer
http://emailajoke.com

----- Original Message ----- 
From: "DEV" <dev at qroute.net>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Monday, January 12, 2004 3:11 PM
Subject: [Javascript] Creating form object properties on the fly


> 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.
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list