JS runtime error in doPostBack with control:control form ID

Discussion in 'ASP .Net' started by Matt Petteys, Aug 14, 2003.

  1. Matt Petteys

    Matt Petteys Guest

    I'm using 1.1 framework and IE 6.0. A form within a user control
    generates the following doPostBack method. The control ID of the form
    is not a valid javascript variable name, ie
    UserProjectDataEntry1:EnterPeriodTime. When the page is loaded, I get a
    runtime error when it parses the following line.

    theform = document.UserProjectDataEntry1:EnterPeriodTime;

    This used to work on the 1.0 framework. Any ideas?

    function __doPostBack(eventTarget, eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    theform = document.forms["UserProjectDataEntry1:EnterPeriodTime"];
    }
    else {
    theform = document.UserProjectDataEntry1:EnterPeriodTime;
    }
    theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }
     
    Matt Petteys, Aug 14, 2003
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.