d@rk_blu3 Posted September 4, 2006 Share Posted September 4, 2006 wazzud! Dude can anyone teach me how to populate bmonth and bday in a dropdown list? I'm going to use it in a Ajax Code Link to comment Share on other sites More sharing options...
aspnetguy Posted September 5, 2006 Share Posted September 5, 2006 use this <html><head> <title></title> <script> onload= function() { var mth = new Array(); mth[0] = "January"; mth[1] = "February"; mth[2] = "March"; mth[3] = "April"; mth[4] = "May"; mth[5] = "June"; mth[6] = "July"; mth[7] = "August"; mth[8] = "Septemeber"; mth[9] = "October"; mth[10] = "November"; mth[11] = "December"; var days = 31; var i = 0; var bmth = document.getElementById('bmth'); var bday = document.getElementById('bday'); for(i=0;i<mth.length;i++) { bmth.options[bmth.options.length] = new Option(mth[i],i); } for(i=0;i<days;i++) { bday.options[bday.options.length] = new Option(i+1,i+1 ); } } </script></head><body> <select id="bmth"></select> <select id="bday"></select></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now