From: Brehm, R. P <rob...@of...> - 2004-09-23 22:08:45
|
All, I am having difficulties running the following dynamic javascript code from an input button (loginSubmit) onclick event called HandleSubmit(): function HandleSubmit() { var userName = document.loginForm.userName.value; var userPassword = document.loginForm.userPassword.value; document.write("<form name=\"loginForm\">"); ... document.write("</form>"); document.loginForm.userName.value = userName; document.loginForm.userPassword.value = userPassword; document.loginForm.loginSubmit.disabled = true; document.loginForm.userName.disabled = true; document.loginForm.userPassword.disabled = true; location.href="login.jsp?userName="+userName+"&userPassword="+userPassword; }//function What I would like to do is to capture the HTML in the GET response generated by location.href by the following snippet: HtmlButtonInput buttonInput= (HtmlButtonInput) form.getInputByName("loginSubmit"); form.getInputByName("userName").setValueAttribute("name"); form.getInputByName("userPassword").setValueAttribute("pwd"); HtmlPage page2 = (HtmlPage) buttonInput.click(); Instead what happens is that the captured HTML is the output from the above document.write() lines. Any help would be appreciated in overcoming this obstacle! Cheers, Bob Brehm Software Engineer Xerox Corp. |