JavaScript not working for chrome
-
Hello Friends, I have a javascript function of enabling and disabling a radio button on the selection of another radio button on the same form. The function is :-
function GetRadioButtonValue()
{
if (document.getElementById("ctl00_Main_RadioButtonList2_0").checked==true)
{
document.getElementById("ctl00_Main_RadioButtonList1_2").disabled=true;
$find('ctl00_Main_AutoCompleteExtender2').set_contextKey(document.getElementById("ctl00_Main_hdl4").value);
}
else if (document.getElementById("ctl00_Main_RadioButtonList2_0").checked==false)
{
document.getElementById("ctl00_Main_RadioButtonList1_2").disabled=false;
$find('ctl00_Main_AutoCompleteExtender2').set_contextKey(document.getElementById("ctl00_Main_hdl5").value);
}
}The same function is successfully running on Mozilla and performing the necessary operation but not working on chrome. Why this is happening I am not able to get. Kindly help. Thanks
Varun Sareen (Dot Net Developer)
-
Hello Friends, I have a javascript function of enabling and disabling a radio button on the selection of another radio button on the same form. The function is :-
function GetRadioButtonValue()
{
if (document.getElementById("ctl00_Main_RadioButtonList2_0").checked==true)
{
document.getElementById("ctl00_Main_RadioButtonList1_2").disabled=true;
$find('ctl00_Main_AutoCompleteExtender2').set_contextKey(document.getElementById("ctl00_Main_hdl4").value);
}
else if (document.getElementById("ctl00_Main_RadioButtonList2_0").checked==false)
{
document.getElementById("ctl00_Main_RadioButtonList1_2").disabled=false;
$find('ctl00_Main_AutoCompleteExtender2').set_contextKey(document.getElementById("ctl00_Main_hdl5").value);
}
}The same function is successfully running on Mozilla and performing the necessary operation but not working on chrome. Why this is happening I am not able to get. Kindly help. Thanks
Varun Sareen (Dot Net Developer)
Hi, Is there a debug function in Chrome ? If so, you should debug your script and see where the problem is (it could be document.GetElementById that returns a null value, because it may not be supported by Chrome). First of all, you need to check which values are returned by the methods you're using ; once you've found them, you have to replace them by ones that Chrome recognizes. Making a web site compatible for all browsers can really be a tricky task.