Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation getElementsByTagName('select') Issue.

    i have 2 prompts


    Beginning Year Month
    &
    EndYearMonth

    I cant seem to get it work.this could be because i am using tagname.if i do by selectElementById(am not sure about the code),it doesnt work out.


    <script>


    var d=new Date()

    var curMonth = d.getMonth();
    var curYear = d.getFullYear();
    if (curMonth == 0)
    { curYear = curYear - 1;
    curMonth = 12
    }
    else
    if(curMonth>=1 && curMonth<10)
    {
    curMonth="0"+curMonth;
    }



    var x1 = document.getElementsByTagName('select');

    var RN_SelectName1 = "_listChoicesEYM";
    var RN_SelectClass1 = "clsSelectControl";

    for (var i=0;i<x1.length;i++)
    {
    if (x1[i].className != RN_SelectClass1) continue;
    for (var j=0;j<x1[i].length;j++)
    {

    if (x1[i].options(j).value == curYear+curMonth.toString())
    {
    x1[i].selectedIndex = j;

    }

    }
    eval('listBoxEYM.checkData()');
    }

    </script>




    please help

    thanks and have a nice day

  • #2
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    right now it shows the same value in both the prompts. i want the beginning prompt to be 13 months before.even after the change,the same value comes in both the prompts.Help!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •