From: Your G. <yo...@br...> - 2004-09-24 21:47:47
|
I know there is currently a problem with javascript doing document.write and then expecting the things it just wrote to appear in the DOM. Could you put this in the form of a failing test? Brad C --- "Brehm, Robert P" <rob...@of...> wrote: > 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. > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |