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
Is there any way to get a link to one of my own files (or pages) to open in a new window the same way that external links can? I tried using the url as an "external link" but iWeb wasn't fooled.It's not the answer to your question. So there is n [More]
Can anyone assist me please. I have just purchased Adobe Photoshop Elements 9 and once I loaded it and tried to organise my photo collection, the system informed me that my iPhoto needed to be upgraded to iPhoto 11. I purchased the upgrade and when I [More]
I apparantly need to replace the monitor for my G4 and can't figure out what will work on it. My husband seems to think that since the original was a VGA, that it needs to be replaced by another VGA. Is it possible that a TFT monitor would work (or w [More]
Hello, We have a requirement to change the Sales Order even if the PO is already created for teh 3rd party order. I am not sure which fields and what changes can we do if the PO is already created for the 3rd Party sales order. Can you please guide m [More]
Hi, We have WLS 10.0 with Jrocket on a Windows Server. We have two domains and they have been working fine for well over a year until this morning. I cannot bring up the Admin Console for the 2 domains. The domains are setup to start up automatically [More]
in my i pad sudenly the sign in to icloud start to pop in to my screen, and i can not do anything even i am writing my passwordHi licaas, If you are having issues with your iPad continuing to ask for your iCloud password you may want to try a couple [More]
I posted this on the NI forum too.I have 1 instance of Kontakt 4.1.1 in Logic 9.1.1 64bit with only 4 sounds loaded and have to set the buffer to Max 1024 otherwise all I get is clicks and pops on playback.The strange part is,when I first loaded this [More]
Hi ,   I have a requirement to change the operation work center of the service order . I am using the BAPI_ALM_ORDER_MAINTAIN . Could anyone let me know how the parameters i_methods and i_operation, i_operationup needs to be passed , what values need [More]
Just upgraded to 5.2 and now I am having problems with all of the RSS feeds.  Now that I need a proxy server just for these dmp's to get information. 1) Is there any workaround, like using the IP address instead of the dns name? 2) is there a really [More]
Hi all, I have a problem with saved passwords in Outlook (2010 and 2013 connected to Exchange 2013). A client sometimes loses its password. I used to have similar problems in our LAN. I resolved it with this article http://searchexchange.techtarget.c [More]