Reputation: 121
//codes
success: function(html){
// this is for input box - working
document.getElementById('val').value='';
$('#val').value='';
// how do i set it for dropdown box to reset after sucess?
document.getElementById('val2').value='';
$('#val2').value='';
}
Once user submit dropdown box, i need it to reset to value="" but now it sticks with user option even after submitted.
Any idea how to achieve that?
Upvotes: 0
Views: 59
Reputation: 65274
try
success: function(html){
$('#val').val('');
$('#val2').find('option:selected').removeAttr('selected');
}
Upvotes: 0