469,923 Members | 1,311 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

validate a textarea only if a certain value is selected in another field

Is it possible to make a textarea required only if a certain value is
selected from a <select>?

I am trying to make a textarea named ObjOther required only if the
value OT is selected from a drop down list named Dmost. Is this
possible to do client side using javascript or do I need to look into
trying this in another language? Thanks in advance for your help.

Josh
Jul 23 '05 #1
2 2377
Lee
Josh said:

Is it possible to make a textarea required only if a certain value is
selected from a <select>?

I am trying to make a textarea named ObjOther required only if the
value OT is selected from a drop down list named Dmost. Is this
possible to do client side using javascript or do I need to look into
trying this in another language? Thanks in advance for your help.


// f = the form you're validating
if(f.Dmost.options[f.Dmost.selectedIndex].value=="OT"){
// validate ObjOther
}

Jul 23 '05 #2
Thanks

On 12 May 2004 10:00:58 -0700, Lee <RE**************@cox.net> wrote:
Josh said:

Is it possible to make a textarea required only if a certain value is
selected from a <select>?

I am trying to make a textarea named ObjOther required only if the
value OT is selected from a drop down list named Dmost. Is this
possible to do client side using javascript or do I need to look into
trying this in another language? Thanks in advance for your help.


// f = the form you're validating
if(f.Dmost.options[f.Dmost.selectedIndex].value=="OT"){
// validate ObjOther
}


Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Csaba Gabor | last post: by
5 posts views Thread by yawnmoth | last post: by
2 posts views Thread by Tim Mills | last post: by
2 posts views Thread by ThunStorm | last post: by
8 posts views Thread by Floortje | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.