Sitemap

Amicuk Programming Answers

Struts : Validating two forms in a single page , on a single submit

-0001-11-30   Views:0

Advertisement

In my JSP page, i have two forms, with modifiable feilds. I'm using submit button of the 2nd form to submit both forms (ie. <form action="someAction2.do" onsubmit="return firstForm.submit();"> ) Two forms have different actions w

In my JSP page, i have two forms, with modifiable feilds. I'm using submit button of the 2nd form to submit both forms (ie. <form action="someAction2.do" onsubmit="return firstForm.submit();"> )
Two forms have different actions which is specified in structs-config.xml. Validation(server-side) is done using validation.xml file.On success/failure, both these actions are mapped to the same (input) JSP page.
Problem is that, validation errors in second form only is displayed. This is because, as soon as 1st form returns validation errors, the second form gets submitted. How can i specify that 2nd form should be submitted only if the 1st form doesnot return any validation errors. I know its possible using javascript at client side, but i want this validation on server-side.
Can any one please help me out. Thanks

The replay answer
Advertisement
Off hand I dont know the answer to your question. But since no one answered your question, here are my 2 cents worth:
I suggest all your JSP pages have one and only one form tag. Re write your JSP page. Make sure all your variables your submitting have unique names. (no duplicate names). As far as I know, having multiple forms on a JSP page is not normallly done and makes it difficult to alter by another programmer after you leave the company.

Go to See the other 4 answers

Struts : Validating two forms in a single page , on a single submit

Category:DefaultRelease time:-0001-11-30Views:130

In my JSP page, i have two forms, with modifiable feilds. I'm using submit button of the 2nd form to submit both forms (ie. <form action="someAction2.do" onsubmit="return firstForm.submit();"> ) Two forms have different actions w[More]

Struts validation

Category:DefaultRelease time:-0001-11-30Views:130

Hi i have a question and was looking forward for your help... during struts validation we use depends="int" so our purpose is to accept values which are pure integers and remaing should be rejected by validator.....but then if we put some text s[More]

Can't get Struts validator to work with ADF 10.1.3.36.73 in Jdev 10.1.3.0.4

Category:DefaultRelease time:2015-10-11Views:130

I am attempting to use the "How to Use the Struts Validator Plug-in with JDeveloper 10g" written by Duncan in a JDeveloper 10.1.3.0.4 application with standard model/ViewController projects. I am using JSP/Struts/ADF technologies. I have perform[More]

Inconsistent Form Behavior on Failed Struts Validation

Category:DefaultRelease time:2015-10-11Views:130

So I'm working on a strange bug regarding an Edit User form for an application, where some fields revert to their default and some fields do not. We have a form for editing users in our system, with most of the usual information inputted in text boxe[More]

Struts validation with BC4J

Category:DefaultRelease time:-0001-11-30Views:130

We're developing an ADF/Struts app. We started off with entity object level validation. However, we'd like nice formatable messages so decided to move towards Struts form beans and perform validation there. Firstly, was this the right thing to do or[More]

Problem in struts validation

Category:DefaultRelease time:-0001-11-30Views:130

hi, i am doing a project using struts framework. i've configured strtus-config.xml , validation.xml but validation framework is not working for me. when i click submitt button without entering any values, it directly maps to the success page. but it[More]

Struts Validations

Category:DefaultRelease time:-0001-11-30Views:130

hi, I've written a Struts application which uses Struts Validations, and used <html:javascript> tag to have client side validations. the problem is , when I start the application, the form is displayed along with the Scripting code of the validator[More]

Struts validation framework not working

Category:DefaultRelease time:-0001-11-30Views:130

Hi I created a very simple webapp and using struts validation framework. But, it always give me validation errors even i filled out all the required firled information. i have my struts-config included the plug-in, points to the location of validatio[More]

How to use the validation.xml in struts validation?

Category:DefaultRelease time:2015-10-11Views:130

Can any one please help me, how to use the validation.xml in struts validation? possible please give me simple example. Edited by: SathishkumarAyyavoo on Jan 31, 2009 12:03 PMThese 2 are the good articles for the beginners to do validation things in[More]

Problem with struts validator on WLS 8.1

Category:DefaultRelease time:2015-10-11Views:130

I am having a strange problem, when I run my app in eclipse using weblogic plugin it works fine and I get no exception. As soon as I run it externally in a standalone server I get an ServletException which seem be be because of struts validator class[More]

Struts validation not working properly

Category:DefaultRelease time:2015-10-11Views:130

Hi, I'm using the struts validator to validate my form.. I've followed all the steps required.. I've checked it quite a few times :) Currently I want to verify if my form fields have any value, so am verifying the required property.. but when I submi[More]

Hot
After watching Matt K's video on how to work around LR's lack of Export as JPEG via the Print module, I tried to follow the same steps however I quickly hit a major roadblock... When I click Page Setup, Print Settings, or Print, I get the Print Setup [More]
I upgraded to IOS5 and iCloud on my MacBook Pro after I upgraded my iMac to iCloud. I keep my phone in sync with my MacBook, but now my Contacts and iCal will not sync with my iPhone3GS.  What have I done wrong?I had the same problem and believe I fi [More]
With the Blend/Gradient Shape tool (W) i can turn a orange square into a green circle or a horizontal line into a vertical line. Beautifull, lots of available effects. One nice thing is that you can edit and bend the path between the shapes to give t [More]
For some reason there a password on the guest user on my mac book pro when I try to login in to for someone to use, I didn't set the password I try to remove it and try disable the guest user but didn't work so don't know what to do please help Resta [More]
Hello, I created a method in AM AMImpl.java class. For that method i created a service interface. In service interface folder i tested web service serviceImpl.java file. But it is unable to read the wsdl document. This might be the reason why i am un [More]
Hi out there.  I'm not even sure if I'm in the right pilace!  First time I've tried this.  Anyway, all of a sudden when I opened the Kodak Gallery from an email someone sent me to see some photos, it would not open and the pop up said I needed to ins [More]
Dear Experts, *RDBMS version - 11.1.0.7 on AIX* I'm noticing a lot of "commit" waits in my 2 node RAC database. Most of them coming from Instance 1. I tried increasing redo log file size and it didn;t seem to fix the issue. Any comments? I'm see [More]
I was shocked to see my bill with a $400 dollar device charge.  No one is willing to work with me to remove the charge since there is no "proof" that I accepted the 2-year terms and conditions. I have five lines on my family plan.  On April 14, [More]
Dear All, Could anyone give me opinions on SAP problems? When we archived object u201CFI_documntu201D, delete a u201CFilesu201D in tcode u201CSARAu201D, the AIX file system u201C/Oarcle/R3P/oraarchu201D was full, SAP and database have stopped, one ar [More]
trying to unlock a iphone 4 with orange ive got the phone off mother in law she rang orange got an email confirming and said it would work today if followed instructions but when i connected to i tunes it said the carrier is not supported please help [More]