Re: [Httpunit-develop] Re: javascript syntax error with struts
Brought to you by:
russgold
From: Russell G. <rus...@ht...> - 2002-10-27 04:04:27
|
On Friday, October 25, 2002, at 11:32 AM, Lars Olsson wrote: > I actually found the problem, the function that the javascript > tries to execute in JavaScript.executeScript looks like this: > > function submit_nodeForm_formAction(newValue,message) { > document.nodeForm.formAction.value=newValue; > if ( message=="" ) { document.nodeForm.submit(); } > else if ( confirm(message) ) { document.nodeForm.submit(); } > }; > --> > > Observe the trailing end comment (-->). This was the syntax error. So I > suppose it is some kind of bug in the parsing in httpunit, but I have > not > had time yet to look at it in detail. I know what this is. Strictly speaking, this is not valid JavaScript. The trailing comment should be: // --> however, it appears that IE tolerates this. It must be a common mistake. HttpUnit does not tolerate it - and probably should. > > Btw, is it possible to set the value of an field in a form > (document.nodeForm.formAction.value=newValue; in the code above)? > I can't get it to work. If not, would it be easy fix? I might give it > a go > this weekend or next week. That is definitely supposed to work. Can you give me a minimal complete HTML page containing this which does not work so that I can try it? |