• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
remove() in jquery not working

Hi can anyone tell me why remove() is not working in the following code
   for (var i=1; i<=31; i++)
   {options += '<option>' + i+'</option>';}

I have two select boxes with ids "mydropdown_for_month" and "mydropdown_for_day". The problem is that when I click any month in the first dropdown , second dropdown normally shows all the dates from for loop as i have mentioned but when i again change the month say from feb to april the second dropdown show dates from 1 to 31 twice (may be 1 to 31 for first i slect month and 1 to 31 again for the second time when i select april). so to solve this i put the following statement
so that on every selection from the first dropdown , second dropdown's all previous options get removed but no use.

Please help me where am i making msitake?

Its hard to guess without seeing your view structure.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.