In my external .js file, I have successfully linked this function...
function SubmitAge(age, UpdatePanelID, HiddenAgeID) {
$get(HiddenAgeID).value = age;
__doPostBack(UpdatePanelID);
}
I am triggering it from an onClick event of an a href="#"
tag.
(tags removed to avoid formatting issues)
a href="#" onclick="SubmitAge(24, 'ctl00_MainContent_arFrom_upAgeRange', 'MainContent_arFrom_HiddenAge')" runat="server" 24 /a
However, I am encountering an error on the first line of the function (line with $get(HiddenAgeID)... etc...)
Error:
Microsoft JScript runtime error: 'null' is null or not an object
When inspecting in Visual Studio .NET, HiddenAgeID shows as an "Undefined identifier Error" while UpdatePanelID appears fine. This issue has left me puzzled and seeking assistance. Any help is appreciated.
Update: Interestingly, the function works flawlessly in FireFox but throws an error in Internet Explorer. It should ideally work in both browsers, so I'm unsure what's causing the discrepancy.