I have this function correctly linked in an external .js file…
function SubmitAge(age, UpdatePanelID, HiddenAgeID) {
$get(HiddenAgeID).value = age;
__doPostBack(UpdatePanelID);
}
and am calling it like this from an onClick of an a href="#" … html tag
(tags removed, please scroll right as stackoverflow has the greatest difficulty in displaying simple content, 7th display related edit, thanks stackoverflow)
a href="#" onclick="SubmitAge(24, 'ctl00_MainContent_arFrom_upAgeRange', 'MainContent_arFrom_HiddenAge')" runat="server" 24 /a
yet, i am getting this error, and its being called on the first line of the SubmitAge function (line with $get(HiddenAgeID)… etc…)
Error:
Microsoft JScript runtime error: 'null' is null or not an object
i’ve copied and pasted my WATCH windows in visual studio .net (vs2010 beta 2 using vb.net & c#) while the execution breaks inside teh SubmitAge .js function…
age 53 Number
UpdatePanelID "ctl00_MainContent_arTo_upAgeRange" String
HiddenAgeID Undefined identifier Error
Why on earth is HiddenAgeId, clearly passed just like UpdatePanelID, is returning an “Undefined identifier Error”??? its perplexed me to the point where i have no room to move! have i missed something guys? thanks – your help or pointers is greatly appreciated.
edit: Update: turns out it works perfectly (as it should) when i load it up in FireFox, but has the resulting error in Internet Explorer, this is not a browser compatibility issue, it should also work in IE, but it doesn’t!
so far, i’ve determined that this is a bug in internet explorer, it really is not expected behaviour, and it can’t be by design under any condition, and i’m almost certain it’s a bug. i have tried everything from rearranging js function arguments to adding dummy arguments, and restarting internet explorer, visual studio and the computer several times with no luck.
so, i’ve decided to put the entire functions contents directly into the onclick=”(lines of code” event attribute, which means that for every single page on my website, the entire functions lines of code will have to be re printed 110 times (a good 20 to 30 KB of download for users)… this is for the time being anyway, until i have the time to find a better solution.
does anyone know if we can give the correct department’s bug report team a link or a pointer to this thread so that they may at least investigate and fix this problem for the betterment of the product? i’m not entirely sure if it’s a vs or ie issue, but i think they would both be concerned by this. am willing to provide problem replication help if needed. thank you to everyone for you help.