Re: validation client-side. Problem with 2 submit buttons
Nice trick. So simple I didn't thought about this. Thanks very much ! On 13/07/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Instead of calling the return validateForm(this) function in the on submit, > you could wrapper the check based on a JavaScript variable. > > var validate = true > > > > validate > don't validate > > > > > Marc Demlenne <[EMAIL PROTECTED]> > > > > > > > > Marc Demlenne <[EMAIL PROTECTED]> > > 07/13/2005 11:30 AM > Please respond to > "Struts Users Mailing List" > > > To > Struts Users Mailing List , Rafael Taboada > <[EMAIL PROTECTED]> > > > cc > > > > Subject > Re: validation client-side. Problem with 2 submit buttons > > > I DO use struts validator framework ... > > What i want is to to have _only_ one of the submit button to check the > client-side validation > > But I can only decide to call validator or not by form, not by button. > As it is for client side that I have this problem, I can't call it > from my modify method... > > On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > > Hi, use Validator framework. > > In this framework u can put code in order to set a client-side > validation > > for each feld. > > In ur modify method, call to ur validate method. > > I hope it can help u > > > > -- > > Rafael Taboada > > Software Engineer > > > > Cell : +511-97753290 > > > > "No creo en el destino pues no me gusta tener la idea de controlar mi > vida" > > > > > > > -- > Marc Demlenne > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation client-side. Problem with 2 submit buttons
Sorry -- missed the 'client-side' bit somehow. ;) On 7/13/05, Jeff Beal <[EMAIL PROTECTED]> wrote: > Set validation off in struts-config and call the Validate method from > within your Action: > > if (yourForm.getAction().equals("action_to_validate")) { > ActionErrors errors = form.validate(/*params*/); > if (errors.isEmpty()) { > // all is good > } else { > saveErrors(errors); > return mapping.findInputForward(); > } > } > > --Jeff > > On 7/13/05, Marc Demlenne <[EMAIL PROTECTED]> wrote: > > I DO use struts validator framework ... > > > > What i want is to to have _only_ one of the submit button to check the > > client-side validation > > > > But I can only decide to call validator or not by form, not by button. > > As it is for client side that I have this problem, I can't call it > > from my modify method... > > > > On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > > > Hi, use Validator framework. > > > In this framework u can put code in order to set a client-side validation > > > for each feld. > > > In ur modify method, call to ur validate method. > > > I hope it can help u > > > > > > -- > > > Rafael Taboada > > > Software Engineer > > > > > > Cell : +511-97753290 > > > > > > "No creo en el destino pues no me gusta tener la idea de controlar mi > > > vida" > > > > > > > > > > > > -- > > Marc Demlenne > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation client-side. Problem with 2 submit buttons
Instead of calling the return validateForm(this) function in the on submit, you could wrapper the check based on a _javascript_ variable. <_javascript_> var validate = true validate don't validate Marc Demlenne <[EMAIL PROTECTED]> Marc Demlenne <[EMAIL PROTECTED]> 07/13/2005 11:30 AM Please respond to "Struts Users Mailing List" To Struts Users Mailing List , Rafael Taboada <[EMAIL PROTECTED]> cc Subject Re: validation client-side. Problem with 2 submit buttons I DO use struts validator framework ... What i want is to to have _only_ one of the submit button to check the client-side validation But I can only decide to call validator or not by form, not by button. As it is for client side that I have this problem, I can't call it from my modify method... On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > Hi, use Validator framework. > In this framework u can put code in order to set a client-side validation > for each feld. > In ur modify method, call to ur validate method. > I hope it can help u > > -- > Rafael Taboada > Software Engineer > > Cell : +511-97753290 > > "No creo en el destino pues no me gusta tener la idea de controlar mi vida" > > -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation client-side. Problem with 2 submit buttons
Set validation off in struts-config and call the Validate method from within your Action: if (yourForm.getAction().equals("action_to_validate")) { ActionErrors errors = form.validate(/*params*/); if (errors.isEmpty()) { // all is good } else { saveErrors(errors); return mapping.findInputForward(); } } --Jeff On 7/13/05, Marc Demlenne <[EMAIL PROTECTED]> wrote: > I DO use struts validator framework ... > > What i want is to to have _only_ one of the submit button to check the > client-side validation > > But I can only decide to call validator or not by form, not by button. > As it is for client side that I have this problem, I can't call it > from my modify method... > > On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > > Hi, use Validator framework. > > In this framework u can put code in order to set a client-side validation > > for each feld. > > In ur modify method, call to ur validate method. > > I hope it can help u > > > > -- > > Rafael Taboada > > Software Engineer > > > > Cell : +511-97753290 > > > > "No creo en el destino pues no me gusta tener la idea de controlar mi vida" > > > > > > > -- > Marc Demlenne > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation client-side. Problem with 2 submit buttons
I DO use struts validator framework ... What i want is to to have _only_ one of the submit button to check the client-side validation But I can only decide to call validator or not by form, not by button. As it is for client side that I have this problem, I can't call it from my modify method... On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > Hi, use Validator framework. > In this framework u can put code in order to set a client-side validation > for each feld. > In ur modify method, call to ur validate method. > I hope it can help u > > -- > Rafael Taboada > Software Engineer > > Cell : +511-97753290 > > "No creo en el destino pues no me gusta tener la idea de controlar mi vida" > > -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation client-side. Problem with 2 submit buttons
Hi, use Validator framework. In this framework u can put code in order to set a client-side validation for each feld. In ur modify method, call to ur validate method. I hope it can help u -- Rafael Taboada Software Engineer Cell : +511-97753290 "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
Re: validation client-side. Problem with 2 submit buttons
If you are using Validator, you can create a DynaForm. then based on the action that you are calling, the validations can be different. This will work for either client side or server side supposedly. I have only used server side with it. Marc Demlenne <[EMAIL PROTECTED]> Marc Demlenne <[EMAIL PROTECTED]> 07/13/2005 10:56 AM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject validation client-side. Problem with 2 submit buttons Hello, Using struts validation framework, what's the best way to handle the following case : You have a simple form with 2 submit buttons. One for display, the other to modify changes. How to make the validation active only for modify button ? Server-side, you can simply have 2 actions name, one of them defined as validate=true, the other as validate=false. Is there a client-side equivalent ? Thanks a lot for any help. -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation client-side. Problem with 2 submit buttons
Hello, Using struts validation framework, what's the best way to handle the following case : You have a simple form with 2 submit buttons. One for display, the other to modify changes. How to make the validation active only for modify button ? Server-side, you can simply have 2 actions name, one of them defined as validate=true, the other as validate=false. Is there a client-side equivalent ? Thanks a lot for any help. -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]