Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Action Not Being Called When Unchanged Form Submitted

Action Not Being Called When Unchanged Form Submitted

Action Not Being Called When Unchanged Form Submitted

I have a struts application that contains JSP pages with
Next, Previous, and Cancel buttons.  My Next and Cancel buttons work great.  However, I cannot get the Previous button to invoke the action mapping if NO changes have been typed onto the form.  There are actually 2 forms on the page.  The first form (not seen below) is included in a header.inc....

Here's a snippet of the JSP:

<form name="Step3Form" method="post" action="/awardBuild/EditAwardDataStep3.do">
    <table border="0" cellspacing="2" cellpadding="2">
                   <td width="600" height="2" colspan="4"><img src="images/horizontalbar.gif"/></td>

<html:submit styleClass="button"  property="<%=Constants.COMMAND%>" value="<%=Constants.EDIT_STEP3%>" ></html:submit>
                <html:submit styleClass="button"  property="<%=Constants.COMMAND%>" value="<%=Constants.PREVIOUS%>" onclick="document.forms[1].submit();"></html:submit>
                <html:cancel styleClass="button"></html:cancel >

I can intercept and trace the EDIT_STEP3 and CANCEL.  The previous just re-displays the current JSP, while I need it to invoke the action to determine the next screen to display based on the mapping path.  Validator is OFF for this JSP.

Any help is greatly appreciated!

RE: Action Not Being Called When Unchanged Form Submitted

Your "previous" button and your "edit_step3" button both use the same property value.

Does your action differentiate between the two correctly?

Your "previous" button submits forms[1] in the onclick event.  Is the html:submit tag for that button inside of forms[1]?  It's possible that the wrong form is being submitted.  

Try making the "previous" button a "<html:button" tag instead of "<html:submit" and use the onclick event to process the action.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close