In reference to this thread:
http://thread.gmane.org/gmane.comp.java.stripes.user/2141/focus=2191

I was looking for a way to perform some client side validation before submitting
my form.  I noticed that if I use the submit button it submits even if
validation fails.
If I use a button tag then I have to create a hidden field similar to what
Jasper did in order to set the eventName.

Note I WANT to use JavaScript for client side validation and then decide whether
or not to submit the form.  This has nothing to do with image styling but is
nevertheless related.

Currently I am using the following code:

function validateSelections(formObj)    {       
        if (isValidSelection(formObj))  {
                $("eventName").name='saveSelections';
                formObj.submit();
        }
        else    {
                return false;
        }
}

Then in the form I have a hidden field: 
<input type="hidden" id="eventName"/>

To be honest, I am not sure how this is working because I couldn’t find anything
in the documentation on “eventName” and Jasper’s post used “stripesevent”.  How
does Stripes resolve this event from these hidden fields with seemingly
arbitrary names?

And more importantly, is there an easier way to do this in stripes?



-------------------------------------------------------------------------
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=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to