views:

30

answers:

3

hi,

//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?

+1  A: 

try this

$('#val').empty();

Gaurav Sharma
A: 
document.getElementById("val2").options.length = 0;
Bar
A: 

try

success: function(html){
   $('#val').val('');

   $('#val2').find('option:selected').removeAttr('selected');
  }
Reigel