Re: Script Question
| From: | Ray Hunter | Date: | Thu, 21 Nov 2002 20:48:55 +0000 |
| Subject: | Re: Script Question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125494@lists.php.net to get a copy of this message | ||
this should be researched in the javascript archives:
google -> groups -> javascript
this is probably what you want
var mytest = document.myform.myfield.value;
if( mytest.toString() == "" )
alert( "No text in " + document.myform.myfield.name );
but i would suggest getting on that group..they are more experienced
with javascript...
On Thu, 2002-11-21 at 13:37, PHP List wrote:
> Same problem, I still get an undefined error.
>
>
> > Try using the string functions.
> >
> > document.myform.mytextfield.value or something...
> >
> > On Thu, 2002-11-21 at 13:25, PHP List wrote:
> > > Hi,
> > > This is more of a Javascript question so please forgive.
> > >
> > > I generate a dynamic form with php.
> > >
> > > I need to be able to test in javascript if a certain field exists:
> > >
> > > .
> > > .
> > > if (document.myform.mytextfield) {
> > > .
> > > .
> > >
> > > This line will give me the javascript error "document.myform.mytextfield
> is undefined"
> > >
> > > If it does exist, then it works fine.
> > >
> > > So how do I test if a field exists without getting an error?
> > >
> > > Thanks for any help.
> > --
> >
> > Ray Hunter
> > email: bigdog@venticon.com
> > www: http://venticon.com
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
--
Ray Hunter
email: bigdog@venticon.com
www: http://venticon.com