Menu

problem clicking on javascript link

Help
Anonymous
2004-05-05
2004-05-06
  • Anonymous

    Anonymous - 2004-05-05

    Hi ALL
    I am not able to get the expected response when I try to click on a image link which calls the JavaScript function from the same page.

    The html looks like this
    <div class="clsButton">
         <a href="javascript:FormSubmit();" onMouseOver="St(64);window.status='';return true;" onMouseOut="Ht()">Log&nbsp;On</a>
         </div>

    and the function is something like this
    function FormSubmit() {
           var expdate = new Date ();
           expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));

           if(document.logonForm.usr.value.length != 0) {
               SetCookieAttrib('Admin_logonForm_usr', document.logonForm.usr.value, expdate, null, null, false);
           };

           var authtype = document.logonForm.auth.value;
           SetCookieAttrib('Admin_logonForm_auth', authtype, expdate, null, null, false);

           document.forms['logonForm'].submit();
        }

    Thanks in Advance

     
    • Anonymous

      Anonymous - 2004-05-05

      In Java code

      link = response.getLinkWith("Log On");
      response = link.click();

      results in a blank page

      <html>
      <head>
      <META HTTP-EQUIV="Refresh" CONTENT="0;URL="/admin/admin.htm">
      </head>
      <body>
      </body>
      </html>

       
    • David Demmer

      David Demmer - 2004-05-05

      Do you get the correct response if you call the Javascript directly? EX:

      WebResponse.Scriptable jscript = resp.getScriptableObject();
      jscript.runScript("javascript", "FormSubmit()");

      Then you'll need to get the WebResponse from the WebConversation's method, getCurrentPage(). EX:

      WebResponse resp = wc.getCurrentPage();

      David

       
    • Anonymous

      Anonymous - 2004-05-06

      It returns the Same response even if I call the JavaScript directly as suggested by you.

      Surya

       

Log in to post a comment.