Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if a drop down list box has been edited

Status
Not open for further replies.

ttrinh

MIS
Jan 21, 2002
93
AU
Hi
How can I use javascript to check if a date drop down list has been edited? ie the date selected in it has been changed on the form?

Thanks
 
Save the initial value when the page is loaded, then check the current value against the saved value.
Code:
window.onload=getSelected;
var s;
function getSelected(){
  s=document.formName.selectName.selectedIndex;
}
function checkSelected(){
  if(s==document.formName.selectName.selectedIndex){
    alert('Select changed');
  }
  else {
    alert('Select did not change');
  }
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top