>Hi All,
>
>When I put a hidden field in an ASP.NET page like this does it need to be inside a form element? Can it just go inside the Content place holder?
Yes. But even in a content place holder, the master page will normally have the content embedded in a form tag. So unless you've removed it from your master page, it should be there.
You don't have to use the named form syntax, you can access it via the form collection:
var control = document.forms[0].elements["hdnIsNew"];
The one issue you may have is that, when the script is run it the page hasn't been fully loaded/parsed so it may fail. You can move it to the bottom just above the closing body tag. You can also add an event handler for the windows onload event.
http://www.quirksmode.org/js/events_advanced.htmlMake sure you read through the entire thing since IE and other browsers actually do this differently (attachEvent vs addEventListener) . You can handle this pretty easily:
if (window.addEventListener)
else if (window.attachEvent)