i need to use function as parameter to another function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siva125
    New Member
    • Feb 2010
    • 9

    i need to use function as parameter to another function

    Code:
    function populatedropdown(dayfield, monthfield, yearfield)
    {
    var today=new Date()
    var dayfield=document.getElementById(dayfield)
    var monthfield=document.getElementById(monthfield)
    var yearfield=document.getElementById(yearfield)
    for (var i=1; i<31; i++)
    dayfield.options[i]=new Option(i, i+1)
    dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day
    for (var m=0; m<12; m++)
    monthfield.options[m]=new Option(monthtext[m], monthtext[m])
    monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true, true) //select today's month
    var thisyear=1990/*today.getFullYear()*/
    for (var y=0; y<40; y++){
    yearfield.options[y]=new Option(thisyear, thisyear)
    thisyear+=1
    }
    yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
    }
    */ 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 */
    Last edited by gits; Mar 19 '10, 09:01 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    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

    Comment

    Working...