There are differences in how a user interacts with html:button and
html:submit.  For instance, pressing enter on some fields can trigger
a submit button, but not a regular button.  You can get the best of
both worlds letting your javascript method determine whether the
submit should happen at all but still letting your submit button
actually submit the form:

<html:submit onclick="return populateAndSubmit()" />

function populateAndSubmit() {
    if (goAheadCondition) {
        // don't call document.ChallengeQuestionForm.submit() here
        // let the submit button do the submit
        return true;
    } else {
        // tell the submit button not to proceed
        return false;
    }
}



On 4/26/07, Krishna, Hari (FTT-CInternet) <[EMAIL PROTECTED]> wrote:
THANKS DUDE It works now

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2007 11:24 AM
To: user@struts.apache.org
Subject: RE: Form submission

You can try replacing the html:submit with html:button and call your
populateAndSubmit() method from the button.


-Pushkar.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to