Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-05-2006, 08:09 PM   PM User | #1
pkrishnava
New to the CF scene

 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
pkrishnava is an unknown quantity at this point
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
pkrishnava is offline   Reply With Quote
Old 12-05-2006, 08:10 PM   PM User | #2
pkrishnava
New to the CF scene

 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
pkrishnava is an unknown quantity at this point
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!!
pkrishnava is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:59 AM.


Advertisement
Log in to turn off these ads.