Forums
This topic is locked
HELP! List/Menu Form Validate
Posted 21 May 2008 20:49:32
1
has voted
21 May 2008 20:49:32 Chris Hoffmann posted:
I have a form that I have validating, and it works fine but with one quirk. I have a drop down menu, with 7 choices, one of them is "other". If the "other" option is chosen, it is required to fill in the text box field named "other". Now that all works, but even after the text box field "other" is filled in, the alert message still pops up that 'the text box other needs to be filled', then submits the form after you hit okay. I'm sure it's just one more line of script, but I can't figure it out, it's probably something easy.... please help!This is the script:
<SCRIPT>
function validate() {
if (Application.EighteenYOA.options[0].selected) {
alert('Eighteen Years of Age, please choose Yes or No.');
event.returnValue=false;}
if (Application.LawsuitType.options[0].selected) {
alert('Please select a Lawsuit Type.');
event.returnValue=false;}
if (Application.ObtainedFunding.options[0].selected) {
alert('Obtained Funding, please choose Yes or No.');
event.returnValue=false;}
if (Application.ChangedAttorney.options[0].selected) {
alert('Changed Attorney, please choose Yes or No.');
event.returnValue=false;}
if (Application.Bankruptcy.options[0].selected) {
alert('Bankruptcy, please choose Yes or No.');
event.returnValue=false;}
if (Application.ReadDisclosure.options[0].selected) {
alert('You must read the disclosures and choose yes.');
event.returnValue=false;}
if (Application.ContactAttorney.options[0].selected) {
alert('Contact Attorney, please choose Yes or No.');
event.returnValue=false;}
if(Application.LawsuitType.options(7).selected) {
alert('You must enter the other type of lawsuit.')
}
}
</SCRIPT>
Probably need another line of script to tell it that if "LawsuitType.options(7).selected" and "other field is filled in" then returnValue=true, but not sure how to write that part of the code.
Thanks in advance!!!!
Chris
Edited by - choff01 on 22 May 2008 19:20:01