Works for me (TM)

form.html :

<html>
<head>
<script type="text/javascript">
function changeQuickSearchAction(theForm) {
      theForm.action ="ok.html";
}
</script>
</head>
<body>
<form name="crudForm" method="get" action="ko.html" 
onsubmit="changeQuickSearchAction(this);return true;">
<input type="submit"/>
</form>
</body>
</html>

ok.html :

<html>
<head>
  <title>OK</title>
</head>
<body>
</body>
</html>


AppTest.java :

public class AppTest extends WebTestCase
{

    public void testApp()
    {
        URL url = this.getClass().getResource("/form.html");
        beginAt(url.toExternalForm());
        submit();
        assertTitleEquals("OK");
        setScriptingEnabled(false);
        beginAt(url.toExternalForm());
        submit();
        assertTitleEquals("KO");
    }
}





----- Message d'origine ----
De : "Saavedra, Gisella" <[EMAIL PROTECTED]>
À : jwebunit-users@lists.sourceforge.net
Envoyé le : Mercredi, 30 Juillet 2008, 23h16mn 12s
Objet : [JWebUnit-users] form onsubmit is not executed by jwebunit

 
I have the following form
<form
name="crudForm" method="post" action="/trips/searchLoads.do"
onsubmit="changeQuickSearchAction(this);return true;">
 
..
</form>
 
with the
javascript code:
 
function changeQuickSearchAction(theForm) {
  
      var theSelect = document.getElementById("searchType");
      var theSelectValue = theSelect.options[theSelect.selectedIndex].value; 
      if (theSelectValue == "equipmentId") {
        theForm.action ="/trips/searchEquipments.do";
      } else {
        theForm.action= "/trips/searchLoads.do";
      }
  }
 
 
 
 
The
script does not seem to be executed.
 
Any
help, I will appreciate it?
 
gs


      
_____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to