I know this is simple but i can't get it to work.
I have a select that has two or three options,each time i click on an option it is removed from the select.
For example if i have two options and click on each the select will be empty.
I want to do a javascript that will verify if the select is empty will show an alert.
The select is in a form so each time i try to do that verification an alert should pop-up and not go to the action page.
This is what i tryied :
HTML Code:
var myindex = document.addtostageform.addressbook_id.selectedIndex;
if (myindex == )
{
alert("\nYou must make a selection from the drop-down menu.");
document.addtostageform.addressbook_id.focus();
}
Thank you.
|