Hi All,
Not sure if this is the right place for this but please advise if its in the wrong place!
We are working on a project using c# / .net and built in Visual Studio. We have made a form which is basically collecting some user information name, address, email etc.
I have put on some form validation from adobe similar to this http://labs.adobe.com/technologies/spry/samples/validationwidgets/with_spry_region/widgets_region.html
The problem is that our form has 2 submit buttons, one is to confirm the page and proceed and the other is to amend previous details. Because we have 2 buttons on the same form the validation runs no matter which button you press, but we only want it to run on the continue button.
Does anyone know of how we can get around this?
thanks
John
Loading
John SimpsonPosted Jan 14, 2009, 3:55 PM
I think your OnClientClick has worked... few more tests for me to make but up to now its doing what I wanted.
I will let you know how I get on...
thanks
John
Guest UserPosted Jan 14, 2009, 2:30 PM
The property is assigned like this: OnClientClick="return YourConfirmationFunction();"
John SimpsonPosted Jan 14, 2009, 1:44 PM
We have tried what you mentioned but still no joy, it apears that the event that causes validation from the spry element javascript is not the same validation event that we can control by using the "causes validation" flag on the button.
The validation we are using is adobe sprys javascript validation which is client side rather than server side, im sure it must be possible to restrict the code running on a particlar button submission though.
do you have any other suggestions which might help?
thanks for your time
John
Guest UserPosted Jan 13, 2009, 5:19 PM
In the Page_Load event of the page that Continue navigates to, check the Page.PreviousPage.IsValid property. If false, then you'll know that the validation failed on the form page and you can programmatically navigate back to it.
John SimpsonPosted Jan 13, 2009, 4:43 PM
thanks for your response, I have just tried adding the CausesValidation="true" to the continue and CausesValidation="false" to the other button but they both still load the validation... do I need to add anything in the .cs file to handle this?
thanks
John
Guest UserPosted Jan 13, 2009, 4:25 PM