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
My existing C: drive is running out of free space. I also want to replace it with a new SSD drive for quicker start-up. I cloned the C: drive (which also included a recovery partition and a D: Data partition) onto the SSD disk. I deleted the duplicat [More]
Hello, I set up some variables by <c:set> and struts tag <bean:size>, and the values should be considered as integers. How can I use the variables in math expression? When I try to use the variables in scriptlets, I got compile errors in the g [More]
I was given a 23in Cinema HD Display (Model # M8536) and I'm trying to hook it up to my MacBook Pro. I got the Mini DisplayPort to DVI Adapter but my computer doesn't even recognize the display. Is this the correct adapter or do I need the dual-link [More]
I'm having some issues with a just installed ZCM 11.3a server. I'm getting a lot of errors: org.jdom.JDOMException: Could not load default SAX parser: org.apache.xerces.parsers.SAXParser: SAX2 driver class org.apache.xerces.parsers.SAXParser not foun [More]
we are using oracle 9.2.0.1.0 database . on top of that we are usinm maximo 5.1 application . but when we try to do insert or select action we will get this error. database error number 17003 has occure.please contact your system administrator for ad [More]
I have a 2007 MBP 2,2 with an 120 GB SATA HDD.  Wondering if I can straight swap an SSD for the original hard disc or if I have to buy the bracket that will replace my optical drive?  Thanks.Yes, you can. No bracket required unless you want to remove [More]
I've installed creme 4.0 beta on my HPx4700 running Windows Mobile 2003 SE (Second edition). But creme fails executing my javacode when executing it with jrun: The error says, that creme cannot find the class. I have tried putting the .class file in [More]
HI friends, i am using the F110 transaction for transfering the cheque and EFT . after entering the  values in parameter, additionla log and print/data medium. when i press  the staus button then it gives the message as"Parameters entered" then [More]
Hi,I have the following code which returns day of week name, position and date and time of surgeries. SELECT DATENAME(WEEKDAY,OPE_START_TIME) AS DOW, [OPE_ORDER_IN_SESS_ASC] AS POSITION, OPE_START_TIME AS [TIME] FROM table1The data looks like thisHow [More]
I am new to jboss.How to deploy ejb in jboss and what is the configuration structure for jboss. Thanks in advance, BalaOnce you have a ejb jar, copy it to $JBOSS_HOME/server/default/deploy, and it will be automatically deployed and started. You can t [More]