Question

  Asked: Jun 2 2008   4:14 PM GMT
  Asked by: Jgtexas


Domino JavaScript combobox validation


Domino, JavaScript, Validation

I would like to ask if someone has a JavaScript code which does the validation on a combobox field. If nothing is selected, a warning pops up and reminds the user that a value has to be selected. I tried to use this code which works fine on regular text fields:

if (document.forms[0].AppName.value == "")
{
alert("You have not selected an application. Please select an application and then continue.");
document.forms[0].AppName.focus();
return false;
}

I would appreciate it if I can get any help on this.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



The value property is directly exposed on single select boxes in IE, but the proper syntax is:

document.forms[0].selectBox.options[document.forms[0].selectBox.selectedIndex].value. You have to access the value as an index of the options collection.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Lotus Domino and Development.

Looking for relevant Lotus Domino Whitepapers? Visit the SearchDomino.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register