Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Thanked 0 Times in 0 Posts

    Please help me out...deadline is evening

    Please help me to do validation for the drop down in using java script.
    The drop down field is in the table of every row. And the rows are creating dynamically.

    The requirement is the drop down field is mandatory.

  2. #2
    Regular Coder
    Join Date
    Apr 2012
    St. Louis, MO
    Thanked 101 Times in 101 Posts
    SELECT tags can be validated in two ways - by selectedIndex, or by the value of the selectedIndex. (Notice the capital "I".. it must be capitalized, or it won't work.)

    If your form name is "formName" and the select is named "selectName":
    if(document.forms["formName"].selectName.selectedIndex == 0) means "if the select is in the first position" (it's a zero-based index.)

    if(document.forms["formName"].options[document.forms["formName"].selectedIndex].value == "") means "if the value of the current selection is blank".

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts