[Javascript] Creating form object properties on the fly

DEV dev at qroute.net
Mon Jan 12 14:56:26 CST 2004


As far as the quotes, you are right. But I just overlooked it when I was
typing it fast. Main question is still remains the same.

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

No. Juat try it and see it for your self.  You will not get any error. And
that is a HELL of a feature that I did not know that until yesterday.


----- Original Message ----- 
From: "Chris Tifer" <christ at saeweb.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Monday, January 12, 2004 12:20 PM
Subject: Re: [Javascript] Creating form object properties on the fly


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




More information about the Javascript mailing list