May I suggest you actually use jQuery ?

var ddlvalue = $('#ddlChannelSelect').val();

This should do the trick.

Michel Belleville


2009/10/30 acetrader <saliba...@gmail.com>

>
> Hi there,
>
> I am not a guru jquery coder and still have to learn alot, recently while
> learning jquery AJAX I have bumped into a weired issue, I have a apge right
> and in this page I have a dropdown list for people to select an RSS channel
> that they wish to know more about, the dropdownlist ahs an onChange event
> which when triggered it will get the value of the selected item in teh
> dropdownlist and post it to the other 'mini' pages that load on the same
> page via AJAX by using the GET method - ie: im passing the parameters like
> a
> normal querystring would.
>
> The problem is that when I assign the dropdown value to a variable called
> dropdown in the following line of code "var dropdown =
> document.getElementById('ddlChannelSelect');" it works in IE but not in the
> other browsers, I have debbugged this in FireBug and it seems that the
> variable dropdownlist is not actually getting the value of the actual
> dropdownlist nad it says 'null' or sometimes 'undefined'. Am I doing
> something wrong ? why is it that it is working in IE but not in other
> browsers ? can you pls give me a solution with some examples ?
>
> this is the function that I have btw:
>
> Code:
>                       function loadChannelAndFeeds()
>                        {
>                                var dropdown =
> document.getElementById('ddlChannelSelect');
>                                var index = dropdown.selectedIndex;
>                                var ddlvalue = dropdown[index].value;
>
>                                /*var ddlvalue =
> document.getElementById('ddlChannelSelect').value*/
>                                var loadChannelOverviewUrl =
> "apmMaterial/apmFeeds/rss2.0/channelOverview.php";
>                                var loadChannelNoteUrl =
> "apmMaterial/apmFeeds/rss2.0/widget_channelNote.php";
>                                var loadFeedsUrl = "rssViewFeeds.php";
>                        AceTrader
> $("#channelNote").html(ajax_load).load(loadChannelNoteUrl ,
> "channelID="+ddlvalue);
>
>
> $("#choChannelOverviewContainer").html(ajax_load).load(loadChannelOverviewUrl
> , "channelID="+ddlvalue);
>
>  $("#feedBox_Result").html(ajax_load).load(loadFeedsUrl ,
> "channelID="+ddlvalue);
>                        }[/code
>
> Thank you very much,
>  :)
> --
> View this message in context:
> http://old.nabble.com/AJAX-page-working-in-IE6%2C7%2C8-but-not-in-Firefox%2CSafari-and-Opera-tp26128182s27240p26128182.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>

Reply via email to