I called the below function using the registerstartupscript block, but the alert returns null, so i couldnot read the object..
please help me to get out from this
function State_Onload()
{
var CurrCode = $find("<%= txtCountry.ClientID%>");
var state = $find("<%= txtStPrTe.ClientID%>");
var objStatelkp = document.getElementById("<%= imgSPTlookup.ClientID%>");
alert(CurrCode);
alert(state);
alert(objStatelkp);
var cCode = CurrCode.get_value();
if (cCode == null)
{
objStatelkp.style.display = 'none';
state.disable();
}
else if (cCode == 'US' || cCode == 'CA' || cCode == 'PR')
{
objStatelkp.style.display = 'block';
state.disable();
}
else
{
objStatelkp.style.display = 'none';
state.enable();
}
}
please help me to get out from this
function State_Onload()
{
var CurrCode = $find("<%= txtCountry.ClientID%>");
var state = $find("<%= txtStPrTe.ClientID%>");
var objStatelkp = document.getElementById("<%= imgSPTlookup.ClientID%>");
alert(CurrCode);
alert(state);
alert(objStatelkp);
var cCode = CurrCode.get_value();
if (cCode == null)
{
objStatelkp.style.display = 'none';
state.disable();
}
else if (cCode == 'US' || cCode == 'CA' || cCode == 'PR')
{
objStatelkp.style.display = 'block';
state.disable();
}
else
{
objStatelkp.style.display = 'none';
state.enable();
}
}