Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cancel drop down list onchange event javascript

$("#country").change(function() {
  var newVal = $(this).val();
  if (!confirm("Are you sure you wish to destroy these country branches?")) {
    $(this).val($.data(this, 'val')); //set back
    return;                           //abort!
  }
  //destroy branches
  $.data(this, 'val', newVal);        //store new value for next time
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cancel #drop #list #onchange #event #javascript
ADD COMMENT
Topic
Name
2+3 =