Adding a select box to Dreamweavers default verify function

Under the tag inspector section in Dreamweaver I set up to verify my form.
It only works with text boxes.
Is there a way to add a select box to the equation?
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

<input name="button" type="submit" id="button" style="background-color:#FF0; color:#006" onclick="MM_validateForm('Name','','R','Address','','R','Zip Code','','R','Email','','RisEmail','Electric Company','','R','Electric Account','','R','Gas Company','','R','Gas Account','','R');return document.MM_returnValue" value="Submit"/>

Open in new window

rivkamakAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineDon't talk to me.Commented:
Don't use the old Javascript validation behaviors anymore.  Those are only in there for compatibility.  Use Spry Validation instead.
rivkamakAuthor Commented:
but the problem with spry validation you just see next to input box and when I have a long form, and you hit submit, you don't see the red information on the top box.
rivkamakAuthor Commented:
I'm looking for a pop up box.
Jason C. LevineDon't talk to me.Commented:
>> when I have a long form

So use JQuery Form Validation if that's a concern as it will also support selects with the kind of alerting you want.  The larger point (and I would think most of the javascript community agrees) is that the internal DW behavior kind of sucks.  It may have been good back in 2001 or so, but in today's world it's dated, tired, and inflexible.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.