By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

i need to use function as parameter to another function

P: 9
Expand|Select|Wrap|Line Numbers
  1. function populatedropdown(dayfield, monthfield, yearfield)
  2. {
  3. var today=new Date()
  4. var dayfield=document.getElementById(dayfield)
  5. var monthfield=document.getElementById(monthfield)
  6. var yearfield=document.getElementById(yearfield)
  7. for (var i=1; i<31; i++)
  8. dayfield.options[i]=new Option(i, i+1)
  9. dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day
  10. for (var m=0; m<12; m++)
  11. monthfield.options[m]=new Option(monthtext[m], monthtext[m])
  12. monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true, true) //select today's month
  13. var thisyear=1990/*today.getFullYear()*/
  14. for (var y=0; y<40; y++){
  15. yearfield.options[y]=new Option(thisyear, thisyear)
  16. thisyear+=1
  17. }
  18. yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
  19. }
*/ date function i set as start date ,i need to set again same function code as end date how to use the function as parameter to other function in javascript */
Mar 18 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 5,328
could you please rephrase your question so that it could be understood better? what exactly do you want to do in which order?

kind regards
Mar 20 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.