Tests for
HtmlForm .
version: $Revision: 2132 $ author: Mike Bowler author: Jun Chen author: George Murnock author: Marc Guillemot author: Ahmed Ashour author: Philip Graf
Simulate a bug report where an anchor contained javascript that caused a form submit.
According to the bug report, the form would be submitted even though the onsubmit
handler would return false.
public void testJSSubmit_JavaScriptAction() throws Exception(Code)
Simulate a bug report where using JavaScript to submit a form that contains a
JavaScript action causes a an "IllegalArgumentException: javascript urls can only
be used to load content into frames and iframes."
throws: Exception - if the test fails
testReset_onResetHandler
public void testReset_onResetHandler() throws Exception(Code)
public void testSubmit_AnchorCausesSubmit_onSubmitHandler_returnFalse() throws Exception(Code)
Simulate a bug report where an anchor contained javascript that caused a form submit.
According to the bug report, the form would be submitted even though the onsubmit
handler would return false. This wasn't reproducible but I added a test for it anyway.
UPDATE: If the form submit is triggered by javascript then the onsubmit handler is not
supposed to be called so it doesn't matter what value it returns.