Menu

ReferenceError: is not defined with submit

Help
Anonymous
2003-11-13
2013-04-26
  • Anonymous

    Anonymous - 2003-11-13

    Hi,

    I am running into a problem with a form submit that is calling a javascript function.  Below is the snippet I took from view source along with the httpunit exception.   Httpunit is able to see the button when did webform.getButtons[0].toString().  Is there a workaround I should try ? 

    Thank you.

    <HEAD> ...
    <SCRIPT LANGUAGE="JavaScript"><!--
    function modLoginFormSubmit2()
    {
      var newurl;
      newurl = 'fastlogin.asp?' + document.loginForm.thisproject[document.loginForm.thisproject.selectedIndex].value;
      newurl = newurl + '&Uid=' + document.loginForm.Uid.value + '&pwd=' + document.loginForm.Pwd.value + '&SavePwdHidden=1&Std=';
      //alert(newurl);
      window.location = newurl;       
    }       
    //--></SCRIPT>
    </HEAD>

    ... <BODY>

    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR>
      <TD><INPUT CLASS="GOLDBUTTON" onClick="this.disabled = 'true'; modLoginFormSubmit2();" TYPE="SUBMIT" VALUE="Login" /></TD>
      <TD>&nbsp;</TD>
      <TD><INPUT CLASS="REDBUTTON" onclick="javascript:window.navigate('default.asp?q=end');" TYPE="button" NAME="Cancel" VALUE="Cancel"  /></TD>
    </TR>
    <TR>
      <TD WIDTH="2"><IMG SRC="Images/1ptrans.gif" WIDTH="2" HEIGHT="2" ALT="" BORDER="0" />
      </TD>
    </TR>                                               
    </TABLE>

    ... </BODY>
    ---- error ----
    1) testLogin(com.companyname.qa.tsLoginTest)junit.framework.AssertionFailedError: Event 'this.disabled = 'true'; modLoginFormSubmit2();' failed: ReferenceError: "modLoginFormSubmit2" is not defined.
            at com.companyname.qa.tsLoginTest.testLogin(tsLoginTest.java:81)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at com.companyname.qa.tsLoginTest.main(tsLoginTest.java:117)

     
    • amodg

      amodg - 2006-06-21

      I Get this error while loading a web page
      ReferenceError: "setPreferences" is not defined.

      Now according to FAQs I have to "submit a request for the offending construct to be supported. "

      But How Do I do that?

       
    • amodg

      amodg - 2006-06-22

      Request all the Admins to help me out.

      'setPreferences();initForm()' are the functions being called while loading the first page i.e.onLoad()

      and I keep getting the error"ReferenceError: "setPreferences" is not defined."

      Please let me know,how to send a request so as to support these functions.

      Will appriciate any suggestions.

       

Log in to post a comment.

MongoDB Logo MongoDB