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

J

Josh

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
 
L

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
}
 
K

ksadmin

Thanks

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
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top