Client-Side validation

2006-02-07 Thread elif akten
Hi,

I try to use client-side validation in struts. but I have a problem.
I have a actionform which I want to verify, in my first jsp some fields of
the form is shown say username, usersurname,email, and in some other jsp
other fields should be checked say gender. address..etc.
I could not define validation rules for that sutiation, is there a way to
define rule in that condition, except define 2 form.


Client Side Validation

2006-03-21 Thread Vinny
Anyone have an example of using client
side validation with a DynaValidatorActionForm ?

I see no examples in here
http://struts.apache.org//struts-doc-1.2.8/userGuide/dev_validator.html
and while the javascript tag descrption is thorough:
(http://struts.apache.org//struts-doc-1.2.8/userGuide/struts-html.html#javascript)
I find it  sort of useless outside of context.

I am using the path attribute as the key in my validation.xml
The form associated with the action is a DynaValidatorActionForm.





now I realize this syntax must be very wrong because I'm getting:
ServletException:  No form found under 'FooLookupAction' in locale 'en_US'

I know that it is  done one way if you use a normal ActionForm for and
another way
for  DynaValidator* . I'm  piuzzled as to why usage examples on the
various permutations
of client side validation have not yet slipped into the docs after all
these years.

Thanks in advance.
Vinny

--
Ghetto Java: http://www.ghettojava.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Client Side Validation

2006-08-01 Thread Chetan Pandey
Hi All:

 

I am trying to do Client-Side Validation for my JSP Form:

 



 



 

 

 



.

.

.

.



 

 

But the problem is I only see Server Side Validations no Client Side
Validations.

 

This is the Validator I am using which I copied from the Net:

 

/***
/









 

/***/

 

 

Does anyone have any Idea why I don't see Client Side Validation



Client-side validation

2007-04-17 Thread Veronica Iturrioz
I have a form with client side validation:

  
  

and an Action with some annotated validations:

@Validations(
requiredStrings = {
@RequiredStringValidator( message = "Required", type = 
ValidatorType.FIELD,fieldName = "name", trim = 
true, key="error.required")


but I get an error because of the key property. If  I delete the key property, 
the client validation executes ok.
In the package.properties I've the error.required key. 

How can I do this? I want to execute client-validation with key messages. 

I try to create a new theme, and replace form-close-validate.ftl :
i replace the line:var error = 
"${validator.getMessage(action)?js_string}";
for:
<#if validator.defaultMessage?has_content>
  var error = "${validator.defaultMessage?js_string}";
 <#else>
 var error = 
"${action.getText(validator.getMessageKey())?js_string}";
     

but the client validation is not executed.  Some themes do not support 
client-side validation. Only useful with theme xhtml/ajax

thanks in advance.
Veronica






__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Enhanced client side validation

2004-10-07 Thread mike . dunn
We have a requirement to validate (using Javascript) beans whose properties
can be of type Map, List, [], or any simple type. Furthermore, Maps, Lists,
and []s can be arbitrarily nested.
 
We have found that the validator only supports simple properties (on the
client). We modified it last year to support Lists and []s. Now we want to
modify it to support Maps and nesting.
 

Here's how it currently works:
 
Suppose a user has a List of addresses:
 
 public class User {
  public List getAddresses() {
   ...
  }
 }
 
and an address has a zip:
 
 public class Address {
  public String getZip() {
   ...
  }
 }
 
So in validation.xml we write:
 
 
 
 
 
 
  property="addresses().phoneNumbers[].areaCode"
...
 
 

Re: Client Side Validation

2006-03-21 Thread Ted Husted
The MailReader application for 1.3 uses DynaValidatorForm's. You could
change those to
DynaValidatorActionForm to test the syntax changes.

* http://svn.apache.org/dist/struts/apps/v1.3.0/

HTH, Ted.


On 3/21/06, Vinny <[EMAIL PROTECTED]> wrote:
> Anyone have an example of using client
> side validation with a DynaValidatorActionForm ?
>
> I see no examples in here
> http://struts.apache.org//struts-doc-1.2.8/userGuide/dev_validator.html
> and while the javascript tag descrption is thorough:
> (http://struts.apache.org//struts-doc-1.2.8/userGuide/struts-html.html#javascript)
> I find it  sort of useless outside of context.
>
> I am using the path attribute as the key in my validation.xml
> The form associated with the action is a DynaValidatorActionForm.
>
>
> 
> // stuff here
>
> 
> 
>
> now I realize this syntax must be very wrong because I'm getting:
> ServletException:  No form found under 'FooLookupAction' in locale 'en_US'
>
> I know that it is  done one way if you use a normal ActionForm for and
> another way
> for  DynaValidator* . I'm  piuzzled as to why usage examples on the
> various permutations
> of client side validation have not yet slipped into the docs after all
> these years.
>
> Thanks in advance.
> Vinny
>
> --
> Ghetto Java: http://www.ghettojava.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
HTH, Ted.
** http://www.husted.com/ted/blog/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client Side Validation

2006-03-21 Thread Laurie Harper
Also, you'll need to move the html:javascript tag inside the html:form 
tag. The reason you're getting an error looking up the form bean is 
because it only exists within the scope of html:form tag. Note that this 
requirement is generally true for form-based tag in the html taglib.


L.

Ted Husted wrote:

The MailReader application for 1.3 uses DynaValidatorForm's. You could
change those to
DynaValidatorActionForm to test the syntax changes.

* http://svn.apache.org/dist/struts/apps/v1.3.0/

HTH, Ted.


On 3/21/06, Vinny <[EMAIL PROTECTED]> wrote:

Anyone have an example of using client
side validation with a DynaValidatorActionForm ?

I see no examples in here
http://struts.apache.org//struts-doc-1.2.8/userGuide/dev_validator.html
and while the javascript tag descrption is thorough:
(http://struts.apache.org//struts-doc-1.2.8/userGuide/struts-html.html#javascript)
I find it  sort of useless outside of context.

I am using the path attribute as the key in my validation.xml
The form associated with the action is a DynaValidatorActionForm.





now I realize this syntax must be very wrong because I'm getting:
ServletException:  No form found under 'FooLookupAction' in locale 'en_US'

I know that it is  done one way if you use a normal ActionForm for and
another way
for  DynaValidator* . I'm  piuzzled as to why usage examples on the
various permutations
of client side validation have not yet slipped into the docs after all
these years.

Thanks in advance.
Vinny

--
Ghetto Java: http://www.ghettojava.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
HTH, Ted.
** http://www.husted.com/ted/blog/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DynaValidatorActionForm client-side validation

2004-04-08 Thread Igor Antonacci
Hi All,
I'm working on DynaValidatorActionForm client-side validation but I've
some problems about.

Everything is working but, as DynaValidatorActionForm maps validation
rules with Action path attribute, Struts generates a client side
validation method name with a "/" character.

It is because Action path has a "/" as first character.

How do I solve this issue ?

Thanks,
Igor.

--
Callidus Software 
Igor Antonacci
Core Engineer
[EMAIL PROTECTED]
--
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client-side validation

2008-03-12 Thread Struts2SG

Hi ,

I wish that you can get some idea about this from the following link,

http://struts2issues.blogspot.com/

Struts2


Veronica Iturrioz wrote:
> 
> I have a form with client side validation:
> 
>  theme="xhtml">
> 
> and an Action with some annotated validations:
> 
> @Validations(
> requiredStrings = {
> @RequiredStringValidator( message = "Required", type =
> ValidatorType.FIELD,fieldName = "name", trim =
> true, key="error.required")
> 
> 
> but I get an error because of the key property. If  I delete the key
> property, the client validation executes ok.
> In the package.properties I've the error.required key. 
> 
> How can I do this? I want to execute client-validation with key messages. 
> 
> I try to create a new theme, and replace form-close-validate.ftl :
> i replace the line:var error =
> "${validator.getMessage(action)?js_string}";
> for:
> <#if validator.defaultMessage?has_content>
>   var error = "${validator.defaultMessage?js_string}";
>  <#else>
>  var error =
> "${action.getText(validator.getMessageKey())?js_string}";
>  
> 
> but the client validation is not executed.  Some themes do not support
> client-side validation. Only useful with theme xhtml/ajax
> 
> thanks in advance.
> Veronica
> 
> 
> 
> 
> 
> 
> __________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

-- 
View this message in context: 
http://www.nabble.com/Client-side-validation-tp1003p16002045.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client-side validation

2008-03-12 Thread Dave Newton
--- Struts2SG <[EMAIL PROTECTED]> wrote:
> I wish that you can get some idea about this from the following link,
> 
> http://struts2issues.blogspot.com/

If you're going to post other people's answers on your blog it would be
polite to properly attribute them. For example, I'm pretty sure "It might
have been quicker to look up the JavaDocs" was me.

I didn't see anything relating to the question being asked anyway.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client Side Validation

2006-08-01 Thread Lixin Chu

do you have something like:
onsubmit="validateAttendeeDetailsForm (this);"
in  ?

and form name is not attendeeDetailsForn ?


RE: Client Side Validation

2006-08-01 Thread Chetan Pandey
I have this:



Where "validateRequired" comes from the following Javascript code in my
validator-rules.xml






    

But no Client-side Validation is occuring

-Original Message-
From: Lixin Chu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 02, 2006 10:35 AM
To: Struts Users Mailing List
Subject: Re: Client Side Validation

do you have something like:
 onsubmit="validateAttendeeDetailsForm (this);"
in  ?

and form name is not attendeeDetailsForn ?




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client Side Validation

2006-08-02 Thread Romu

your form shoud have been named :
attendeeDetailsForm, like bean no caps for first letter .

then
validateAttendeeDeta


onsubmit="validateAttendeeDeta
>
> ilsForm ();

 or

validateAttendeeDeta


onsubmit="validateAttendeeDeta
>
> ilsForm (this);
>


u can see the javascript generated in the source of your jsp btw .
hope it helps






2006/8/2, Chetan Pandey <[EMAIL PROTECTED]>:


I have this:



Where "validateRequired" comes from the following Javascript code in my
validator-rules.xml




    
 


But no Client-side Validation is occuring

-Original Message-
From: Lixin Chu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 02, 2006 10:35 AM
To: Struts Users Mailing List
Subject: Re: Client Side Validation

do you have something like:
onsubmit="validateAttendeeDetailsForm (this);"
in  ?

and form name is not attendeeDetailsForn ?




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Client Side Validation

2006-08-02 Thread Chetan Pandey
Hi All:

This is what I am doing.


.
.
.
.
.
.




But the Code only does Server Side Validation.

Am I missing naything pls.

Thanks.

Chetan Pandey

-Original Message-
From: Romu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 02, 2006 3:28 PM
To: Struts Users Mailing List
Subject: Re: Client Side Validation

your form shoud have been named :
attendeeDetailsForm, like bean no caps for first letter .

then
validateAttendeeDeta
>
> onsubmit="validateAttendeeDeta
> >
> > ilsForm ();
>
>  or
validateAttendeeDeta
>
> onsubmit="validateAttendeeDeta
> >
> > ilsForm (this);
> >
>
u can see the javascript generated in the source of your jsp btw .
hope it helps






2006/8/2, Chetan Pandey <[EMAIL PROTECTED]>:
>
> I have this:
>
> 
>
> Where "validateRequired" comes from the following Javascript code in my
> validator-rules.xml
>
>  classname="org.apache.struts.validator.FieldChecks"
>method="validateRequired"
>  methodParams="java.lang.Object,
>org.apache.commons.validator.ValidatorAction,
>org.apache.commons.validator.Field,
>org.apache.struts.action.ActionMessages,
>org.apache.commons.validator.Validator,
>        javax.servlet.http.HttpServletRequest"
>   msg="errors.required">
>
>
> 
>  
> 
>
> But no Client-side Validation is occuring
>
> -Original Message-
> From: Lixin Chu [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 02, 2006 10:35 AM
> To: Struts Users Mailing List
> Subject: Re: Client Side Validation
>
> do you have something like:
> onsubmit="validateAttendeeDetailsForm (this);"
> in  ?
>
> and form name is not attendeeDetailsForn ?
>
>
>
>
> -
> 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: Client Side Validation

2006-08-02 Thread Irwan Nurwandi

Dear Chetan

Look at your bean form definition in your validation.xml

if you specify the form bean like this :



   


then you should call generated javascript with this



the first letter in form bean name shouls be in lowercase also...

HTH
Irwan

On 8/3/06, Chetan Pandey <[EMAIL PROTECTED]> wrote:

Hi All:

This is what I am doing.


.
.
.
.
.
.




But the Code only does Server Side Validation.

Am I missing naything pls.

Thanks.

Chetan Pandey

-Original Message-
From: Romu [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 02, 2006 3:28 PM
To: Struts Users Mailing List
Subject: Re: Client Side Validation

your form shoud have been named :
attendeeDetailsForm, like bean no caps for first letter .

then
validateAttendeeDeta
>
> onsubmit="validateAttendeeDeta
> >
> > ilsForm ();
>
>  or
validateAttendeeDeta
>
> onsubmit="validateAttendeeDeta
> >
> > ilsForm (this);
> >
>
u can see the javascript generated in the source of your jsp btw .
hope it helps






2006/8/2, Chetan Pandey <[EMAIL PROTECTED]>:
>
> I have this:
>
> 
>
> Where "validateRequired" comes from the following Javascript code in my
> validator-rules.xml
>
>  classname="org.apache.struts.validator.FieldChecks"
>method="validateRequired"
>  methodParams="java.lang.Object,
>org.apache.commons.validator.ValidatorAction,
>org.apache.commons.validator.Field,
>org.apache.struts.action.ActionMessages,
>org.apache.commons.validator.Validator,
>        javax.servlet.http.HttpServletRequest"
>   msg="errors.required">
>
>
> 
>  
> 
>
> But no Client-side Validation is occuring
>
> -Original Message-
> From: Lixin Chu [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 02, 2006 10:35 AM
> To: Struts Users Mailing List
> Subject: Re: Client Side Validation
>
> do you have something like:
> onsubmit="validateAttendeeDetailsForm (this);"
> in  ?
>
> and form name is not attendeeDetailsForn ?
>
>
>
>
> -
> 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]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Client Side Validation

2006-08-03 Thread Chetan Pandey
I have changed the name to attendeeDetailsForm everywhere as you have
suggested

And have 
html:form action="/addAttendeeDetails" onsubmit="return
 validateAttendeeDetailsForm(this)">

But this is not helping me still.

I only get Server side validation, no Client Side Validation.

Thanks.

Chetan Pandey



-Original Message-
From: Irwan Nurwandi [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 03, 2006 2:13 PM
To: Struts Users Mailing List
Subject: Re: Client Side Validation

Dear Chetan

Look at your bean form definition in your validation.xml

if you specify the form bean like this :






then you should call generated javascript with this



the first letter in form bean name shouls be in lowercase also...

HTH
Irwan

On 8/3/06, Chetan Pandey <[EMAIL PROTECTED]> wrote:
> Hi All:
>
> This is what I am doing.
>
> 
> .
> .
> .
> .
> .
> .
> 
> 
>
>
> But the Code only does Server Side Validation.
>
> Am I missing naything pls.
>
> Thanks.
>
> Chetan Pandey
>
> -Original Message-
> From: Romu [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 02, 2006 3:28 PM
> To: Struts Users Mailing List
> Subject: Re: Client Side Validation
>
> your form shoud have been named :
> attendeeDetailsForm, like bean no caps for first letter .
>
> then
> validateAttendeeDeta
> >
> > onsubmit="validateAttendeeDeta
> > >
> > > ilsForm ();
> >
> >  or
> validateAttendeeDeta
> >
> > onsubmit="validateAttendeeDeta
> > >
> > > ilsForm (this);
> > >
> >
> u can see the javascript generated in the source of your jsp btw .
> hope it helps
>
>
>
>
>
>
> 2006/8/2, Chetan Pandey <[EMAIL PROTECTED]>:
> >
> > I have this:
> >
> > 
> >
> > Where "validateRequired" comes from the following Javascript code in my
> > validator-rules.xml
> >
> >  > classname="org.apache.struts.validator.FieldChecks"
> >method="validateRequired"
> >  methodParams="java.lang.Object,
> >org.apache.commons.validator.ValidatorAction,
> >    org.apache.commons.validator.Field,
> >org.apache.struts.action.ActionMessages,
> >org.apache.commons.validator.Validator,
> >javax.servlet.http.HttpServletRequest"
> >   msg="errors.required">
> >
> >
> > 
> >  
> > 
> >
> > But no Client-side Validation is occuring
> >
> > -Original Message-
> > From: Lixin Chu [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 02, 2006 10:35 AM
> > To: Struts Users Mailing List
> > Subject: Re: Client Side Validation
> >
> > do you have something like:
> > onsubmit="validateAttendeeDetailsForm (this);"
> > in  ?
> >
> > and form name is not attendeeDetailsForn ?
> >
> >
> >
> >
> > -
> > 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]
>
>

-
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]



client-side validation javascript error

2004-10-26 Thread Jeffrey Ford
Hi,

I'm trying to get client-side validation to work using Struts, v. 1.2.2.
More specifically, I'm receiving a javascript error while trying to use the
'required' validation rule.  The error in IE says:

Error: 'required' is undefined

When I look at the generated javascript, this is indeed true.  However,
there's a function called 'locationForm_required' where 'locationForm' is
the name of my form.  It seems that the 'validateRequired' method should be
calling a 'new locationForm_required( )' instead of a 'new required( ).

function locationForm_required () {
 this.a0 = new Array("shortDescription", "Short Description is
required.", new Function ("varName", " return this[varName];"));
}

function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
...  


Does anyone have any insight into this?

Thanks in advance,
Jeff




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Toomany Client-side validation code!!!

2004-08-19 Thread Rajesh
Hai all
when we use Struts Validator in client side, it creates too big and many 
unwanted functions in the client side,

is it possible to reduce or copy all javascript functioins into .js file 
and attach them so client dont want to read too much codes ?

any solution there in Struts 1.1
Thanks,
Rajesh
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorActionForm client-side validation

2004-04-08 Thread Adam Hardy
Hmmm, good question. I had this problem, but never managed to solve it. 
I thought I was doing something wrong but I couldn't work it out. 
Eventually I changed to DynaValidatorForm, which wasn't a big problem 
because there were only 2 or 3 forms where I wanted to use the same 
DynaForm but different validation.

Perhaps someone actually knows if there is a solution?



On 04/08/2004 11:16 AM Igor Antonacci wrote:
Hi All,
I'm working on DynaValidatorActionForm client-side validation but I've
some problems about.
Everything is working but, as DynaValidatorActionForm maps validation
rules with Action path attribute, Struts generates a client side
validation method name with a "/" character.
It is because Action path has a "/" as first character.

How do I solve this issue ?

Thanks,
Igor.
--
Callidus Software 
Igor Antonacci
Core Engineer
[EMAIL PROTECTED]
--
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: DynaValidatorActionForm client-side validation

2004-04-08 Thread Saul Q Yuan
Hmmm, I don't seem to have that problem. Did you specify
method="validateYourActionForm" in addition to:
formName="/yourActionPath" in your  -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 08, 2004 3:02 PM
> To: Struts Users Mailing List
> Subject: Re: DynaValidatorActionForm client-side validation
> 
> 
> Hmmm, good question. I had this problem, but never managed to 
> solve it. 
> I thought I was doing something wrong but I couldn't work it out. 
> Eventually I changed to DynaValidatorForm, which wasn't a big problem 
> because there were only 2 or 3 forms where I wanted to use the same 
> DynaForm but different validation.
> 
> Perhaps someone actually knows if there is a solution?
> 
> 
> 
> On 04/08/2004 11:16 AM Igor Antonacci wrote:
> > Hi All,
> > I'm working on DynaValidatorActionForm client-side 
> validation but I've 
> > some problems about.
> > 
> > Everything is working but, as DynaValidatorActionForm maps 
> validation 
> > rules with Action path attribute, Struts generates a client side 
> > validation method name with a "/" character.
> > 
> > It is because Action path has a "/" as first character.
> > 
> > How do I solve this issue ?
> > 
> > Thanks,
> > Igor.
> > 
> > --
> > Callidus Software
> > Igor Antonacci
> > Core Engineer
> > [EMAIL PROTECTED]
> > --
> >  
> > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> struts 1.2 + tomcat 5.0.19 + java 1.4.2
> Linux 2.4.20 Debian
> 
> 
> -
> 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: DynaValidatorActionForm client-side validation

2004-04-08 Thread Kunal H. Parikh
I may be a little off here, but why are you using the
DynaValidatorActionForm ?

Try using the DynaValidatorForm and u should have client-side and
server-side validation working.

This is because, the DynaValidatorActionForm.getValidationKey returns the
mapping PATH, whereas the DynaValidatorForm.getValidationKey returns the
mapping NAME!

HTH,

KP


-Original Message-
From: Saul Q Yuan [mailto:[EMAIL PROTECTED] 
Sent: Friday, 9 April 2004 06:03
To: 'Struts Users Mailing List'
Subject: RE: DynaValidatorActionForm client-side validation

Hmmm, I don't seem to have that problem. Did you specify
method="validateYourActionForm" in addition to:
formName="/yourActionPath" in your  -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 08, 2004 3:02 PM
> To: Struts Users Mailing List
> Subject: Re: DynaValidatorActionForm client-side validation
> 
> 
> Hmmm, good question. I had this problem, but never managed to 
> solve it. 
> I thought I was doing something wrong but I couldn't work it out. 
> Eventually I changed to DynaValidatorForm, which wasn't a big problem 
> because there were only 2 or 3 forms where I wanted to use the same 
> DynaForm but different validation.
> 
> Perhaps someone actually knows if there is a solution?
> 
> 
> 
> On 04/08/2004 11:16 AM Igor Antonacci wrote:
> > Hi All,
> > I'm working on DynaValidatorActionForm client-side 
> validation but I've 
> > some problems about.
> > 
> > Everything is working but, as DynaValidatorActionForm maps 
> validation 
> > rules with Action path attribute, Struts generates a client side 
> > validation method name with a "/" character.
> > 
> > It is because Action path has a "/" as first character.
> > 
> > How do I solve this issue ?
> > 
> > Thanks,
> > Igor.
> > 
> > --
> > Callidus Software
> > Igor Antonacci
> > Core Engineer
> > [EMAIL PROTECTED]
> > --
> >  
> > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> struts 1.2 + tomcat 5.0.19 + java 1.4.2
> Linux 2.4.20 Debian
> 
> 
> -
> 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]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DynaValidatorActionForm client-side validation

2004-04-09 Thread Adam Hardy
Yes I know, and it's for a reason. DynaValidatorActionForm doesn't exist 
by chance.

Regarding the javascript function names, it's not the main validation 
function name that's the problem - it's the secondary functions which 
instantiate the arrays for the different validations, e.g. 
surveyForm_required(), surveyForm_IntegerValidations(), 
surveyForm_DateValidations()

Under ValidatorActionForm, they become

/esurvey/survey/update_required()
etc
which are invalid.

If nobody says anything different, I'm going to log this as a bug, if 
it's not there already.

I'm not sure why, but I've just realised this thread was going to both 
user and dev lists, which is totally unnecessary! I'm just sending this 
reply to user.



On 04/09/2004 08:43 AM Kunal H. Parikh wrote:
I may be a little off here, but why are you using the
DynaValidatorActionForm ?
Try using the DynaValidatorForm and u should have client-side and
server-side validation working.
This is because, the DynaValidatorActionForm.getValidationKey returns the
mapping PATH, whereas the DynaValidatorForm.getValidationKey returns the
mapping NAME!
HTH,

KP

-Original Message-
From: Saul Q Yuan [mailto:[EMAIL PROTECTED] 
Sent: Friday, 9 April 2004 06:03
To: 'Struts Users Mailing List'
Subject: RE: DynaValidatorActionForm client-side validation

Hmmm, I don't seem to have that problem. Did you specify
method="validateYourActionForm" in addition to:
formName="/yourActionPath" in your 
HTH,
Saul

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 08, 2004 3:02 PM
To: Struts Users Mailing List
Subject: Re: DynaValidatorActionForm client-side validation

Hmmm, good question. I had this problem, but never managed to 
solve it. 
I thought I was doing something wrong but I couldn't work it out. 
Eventually I changed to DynaValidatorForm, which wasn't a big problem 
because there were only 2 or 3 forms where I wanted to use the same 
DynaForm but different validation.

Perhaps someone actually knows if there is a solution?



On 04/08/2004 11:16 AM Igor Antonacci wrote:

Hi All,
I'm working on DynaValidatorActionForm client-side 
validation but I've 

some problems about.

Everything is working but, as DynaValidatorActionForm maps 
validation 

rules with Action path attribute, Struts generates a client side 
validation method name with a "/" character.

It is because Action path has a "/" as first character.

How do I solve this issue ?

Thanks,
Igor.
--
Callidus Software
Igor Antonacci
Core Engineer
[EMAIL PROTECTED]
--



-

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
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]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaValidatorActionForm client-side validation

2004-04-09 Thread Niall Pemberton
A patch recently went into the various flavours of validator forms which
split out the logic which determines the validation "key" into a separate
method - so if you look at the current versions of either
ValidatorActionForm or DynaValidatorActionForm - they now only contain a
very simple getValidationKey(request, mapping) method.

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/validator/

I use a version of  DynaValidatorActionForm which removes the leading "/" -
for Adam's problem (where he has "/esurvey/survey/update") he could do that
and replace the other slashes with underscores:

public class MyDynaValidatorActionForm extends DynaValidatorForm
  implements DynaBean, Serializable {

  public String getValidationKey(ActionMapping mapping,
   HttpServletRequest request) {

mapping.getPath().substring(1).replace('/', '_');

  }
}

Then, in validation.xml

   

 


and on the jsp page:



If you can't use the latest build of struts, then copy the validate() method
which calls getValidationKey() - when the next proper "release" of struts
comes out, you can then delete the validate() method just leaving
getValidationKey().

Niall


- Original Message - 
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, April 08, 2004 8:02 PM
Subject: Re: DynaValidatorActionForm client-side validation


> Hmmm, good question. I had this problem, but never managed to solve it.
> I thought I was doing something wrong but I couldn't work it out.
> Eventually I changed to DynaValidatorForm, which wasn't a big problem
> because there were only 2 or 3 forms where I wanted to use the same
> DynaForm but different validation.
>
> Perhaps someone actually knows if there is a solution?
>
>
>
> On 04/08/2004 11:16 AM Igor Antonacci wrote:
> > Hi All,
> > I'm working on DynaValidatorActionForm client-side validation but I've
> > some problems about.
> >
> > Everything is working but, as DynaValidatorActionForm maps validation
> > rules with Action path attribute, Struts generates a client side
> > validation method name with a "/" character.
> >
> > It is because Action path has a "/" as first character.
> >
> > How do I solve this issue ?
> >
> > Thanks,
> > Igor.
> >
> > --
> > Callidus Software
> > Igor Antonacci
> > Core Engineer
> > [EMAIL PROTECTED]
> > --
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> -- 
> struts 1.2 + tomcat 5.0.19 + java 1.4.2
> Linux 2.4.20 Debian
>
>
> -
> 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]



Struts 2 Client-side Validation

2008-02-27 Thread Thaminda Karunanayake
Hi all,


Can password confirmation be validated using client side validators in
Struts 2 ...?



Thanks

Thaminda


Client Side Validation with Struts

2008-03-28 Thread Asad Habib
Hello. I am validating data on the client-side using the Javascript
onsubmit event handler and this is working just fine. The problem I am
having is with trying to prevent the action from being called after
the alert window is closed. Is it possible to do this? If so, how?
Also, for client side validation with Struts, do I need to use the
validator? Any help would be appreciated. Thank you.

- Asad

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2 Client Side Validation

2007-07-12 Thread Néstor Boscán
Hi
 
I'm trying to use Struts 2 with client side validation. I would like to use
a theme that does not add any HTML to the form, fields and error messages.
I'm working with simple theme but it's not generating the JavaScript code to
do the validation and the  tag is generation 
elements.
 
Any ideas?
 
Regards,
 
Néstor Boscán


Datetimepicker and client-side validation

2008-09-11 Thread Kawczynski, David
I am using the datetimepicker on a form with client-side validation
enabled.  
Form submissions with a blank datetime field should result in validation

being run against that field.  This is not the case -- this field is
only
validated on the server.  No other form field uses the dojo, and they
are all
validated on the client-sided correctly.  What do I have to do so the 
datetimepicker field receives client-sided validation like the other
fields?  
(I'm using struts 2.1.2 with xwork 2.1.1)

Thanks in advance,
-dave



===
===
==THE struts.xml:

http://struts.apache.org/dtds/struts-2.0.dtd";>

  

  
  
  
  
  
  


  /admin/siterequest/request_form_thanks.jsp
  /admin/siterequest/request_form.jsp
  /admin/siterequest/request_form.jsp

  





===
===
==THE SiteRequestAction-save-validation.xml:


http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>

  

  true
  "Submitter ISID" is required


  8
  "Submitter ISID" must be 8 characters or less

  
  

  true
  "Business Area" is required

  
  

  true
  "Project Title" is required


  200
  "Project Title" must be 200 characters or less

  
  

  true
  "Description" is required


  2000
  "Description" must be 2000 characters or less

  
  

  true
  "Site Name" is required


  200
  "Site Name" must be 200 characters or less

  
  

  true
  "Issue Type" is required

  
  

  "Desired Release Date" is required.


  08/01/2008
  01/01/2030
  Invalid "Desired Release Date"

  




===
===
==THE jsp page:

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>


  
Change Request Submission Form



  
  

  Change Request Submission Form

  Please complete the form below to submit a request to the
Global 
  Solutions Delivery group.  You will receive a response within 2
business
  days.

  Items marked with an asterisk (*)
are 
  required.
  
  

  
  
  
  
  
  
  
  
  

  

  
  




===
===
==THE action class:

package siterequest;
import java.util.Map;
import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class SiteRequestAction extends ActionSupport 
  implements Preparable, SessionAware {
  
  /**
   * Performs all functionality required when saving a [EMAIL PROTECTED]
SiteRequest}.
   * 
   * @return 
   * a String indicating "success" or "failure".  If "failure", 
   * this action's [EMAIL PROTECTED] #exception} property will be
populated.
   */
  public String save() {
try {
  this.siteRequestFacade.save(this.siteRequest);
  return "success";
}
catch (Throwable exception) {
  logger.error("Unable to save SiteRequest: ", exception);
  setException(exception);
  return "failure";
}
  }
  
  public void prepare() throws Exception {
this.siteRequestFacade = new SiteRequestFacade();
this.siteRequest = new SiteRequest();
this.siteRequestList = new ArrayList();
  }

  public void setSession(Map session) {
this.session = session;
  }

  public SiteRequest getSiteRequest() {
return siteRequest;
  }

  public void setSiteRequest(SiteRequest siteRequest) {
this.siteRequest = siteRequest;
  }

  private Map session;
  private SiteRequest siteRequest;
  private SiteRequestFacade siteRequestFacade;
  private Throwable exception;
  private Logger logger = Logger.getLogger(this.getClass());
}



===
===
==THE action form class:

package siterequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Blob;
import java.sql.SQLException;
import ja

Client Side Validation Not Working

2008-11-18 Thread Rabin Aryal
Guys,

 

I don't know what I am doing wrong. I am missing the actual validation
JavaScript code in the generated html when accessing
add_comment.do?blogid=23. I have included the snippet below.

 

 

addcomment.jsp

 







"







 

struts.xml 

 

 

/blog/addcomment.jsp



 

 

/blog/addcomment.jsp

/blog/addcomment.jsp



 

 

CommentAction-save-validation.xml

 







true

Name is required









true

Comment is required







 

 

Generated html by browser when accessing add_comment.do?blogid=23

 



...

...

...

function validateForm_save_comment() 

{

 

form = document.getElementById("save_comment");

 

clearErrorMessages(form);

 

clearErrorLabels(form);

 

var errors = false;

 

// Missing actual validation here..

 

return !errors;

}

 

I would really appreciate is anyone has idea what am I doing wrong.

 

Thanks 

Rabin 



client side validation in struts2

2011-02-15 Thread dasariprasad
t.java:389)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:332)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorKey(AnnotationActionValidatorManager.java:212)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:69)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:65)
at org.apache.struts2.components.Form.getValidators(Form.java:265)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at freemarker.ext.beans.BeansWrapper.invokeMet
-- 
View this message in context: 
http://old.nabble.com/client-side-validation-in-struts2-tp30931442p30931442.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: client-side validation javascript error

2004-10-26 Thread Niall Pemberton
Version 1.2.2 of Struts was withdrawn because of problems. The current "ga"
quality release of Struts is Version 1.2.4

http://struts.apache.org/acquiring.html

Niall

- Original Message - 
From: "Jeffrey Ford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 26, 2004 5:52 PM
Subject: client-side validation javascript error


> Hi,
>
> I'm trying to get client-side validation to work using Struts, v. 1.2.2.
> More specifically, I'm receiving a javascript error while trying to use
the
> 'required' validation rule.  The error in IE says:
>
> Error: 'required' is undefined
>
> When I look at the generated javascript, this is indeed true.  However,
> there's a function called 'locationForm_required' where 'locationForm' is
> the name of my form.  It seems that the 'validateRequired' method should
be
> calling a 'new locationForm_required( )' instead of a 'new required( ).
>
> function locationForm_required () {
>  this.a0 = new Array("shortDescription", "Short Description is
> required.", new Function ("varName", " return this[varName];"));
> }
>
> function validateRequired(form) {
> var isValid = true;
> var focusField = null;
> var i = 0;
> var fields = new Array();
> oRequired = new required();
> for (x in oRequired) {
> var field = form[oRequired[x][0]];
> ...  
>
>
> Does anyone have any insight into this?
>
> Thanks in advance,
> Jeff
>
>
>
>
> -
> 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: Toomany Client-side validation code!!!

2004-08-19 Thread Shinobu Kawai

Hi Rajesh,

> when we use Struts Validator in client side, it creates too big and many 
> unwanted functions in the client side,
> 
> is it possible to reduce or copy all javascript functioins into .js file 
> and attach them so client dont want to read too much codes ?
Take a look at
http://struts.apache.org/userGuide/struts-html.html#javascript
2nd paragraph gives you the answer.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]>




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Toomany Client-side validation code!!!

2004-08-19 Thread Rajesh
Hai
you  mean dynamicJavascript=false
what will happen if i give it.
normally html:javascript will create a main function called
validate(form) {}
will this function writes ?  if so then where all the other functions goes ?
Rajesh
Shinobu Kawai wrote:
Hi Rajesh,
 

when we use Struts Validator in client side, it creates too big and many 
unwanted functions in the client side,

is it possible to reduce or copy all javascript functioins into .js file 
and attach them so client dont want to read too much codes ?
   

Take a look at
   http://struts.apache.org/userGuide/struts-html.html#javascript
2nd paragraph gives you the answer.
Best regards,
-- Shinobu Kawai
--
Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]>

-
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: Toomany Client-side validation code!!!

2004-08-19 Thread Shinobu Kawai

Hi Rajesh,

> you  mean dynamicJavascript=false
> 
> what will happen if i give it.
> 
> normally html:javascript will create a main function called
> 
> validate(form) {}
> 
> will this function writes ?  if so then where all the other functions goes ?
The javascript tag produces javascript in two parts: dynamic and static. 
The dynamic part is the one you stated above, and it is made per form,
according to the validation.xml.  The static part is the same whatever
way you do it.  It is the static part that you would want to throw out
into a .js file or whatever.  The dynamic part, I suggest you stick with
it.

Anyways, quoting the user guide, "if dynamicJavascript is set to true
and staticJavascript is set to false then only the dynamic JavaScript
will be rendered".  Put this in each of your JSP's.  "If
dynamicJavascript is set to false and staticJavascript is set to true
then only the static JavaScript will be rendered".  Put this in a
separate JSP and include that JSP in all of your other JSP's.

> >Take a look at
> >http://struts.apache.org/userGuide/struts-html.html#javascript
> >2nd paragraph gives you the answer.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]>




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[SOLVED} RE: DynaValidatorActionForm client-side validation

2004-04-09 Thread Igor Antonacci
Hi,
I solved with your advice.

Thanks a lot! 
Igor.

> -Original Message-
> From: Saul Q Yuan [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 08, 2004 10:03 PM
> To: 'Struts Users Mailing List'
> Subject: RE: DynaValidatorActionForm client-side validation
> 
> Hmmm, I don't seem to have that problem. Did you specify
> method="validateYourActionForm" in addition to:
> formName="/yourActionPath" in your  function generated will be validateYourActionForm. I could be 
> wrong, but
> don't have time now to dig deep into the code.
> 
> HTH,
> Saul
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



newbie question on client-side validation

2005-03-03 Thread Jennifer Ball
Hello,
I am having trouble creating the client-side JavaScript for a custom 
validator.  Basically, the validator checks if the user input matches 
one of a set of 3 strings.  I've written the server-side code but need 
help with the JavaScript.

I have looked at the standard validator-rules.xml file for examples, but 
I still have questions.  For example, the validateMask function creates 
a new Mask object, but I don't see where this constructor is located and 
what exactly it does.

I've searched for documentation on this topic, but all materials I've 
found have glossed over the topic.  Could someone give me a brief 
explanation or point me to one?

thanks,
Jennifer
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Client side validation for radio button

2007-10-11 Thread Mitch Claborn
Using the xhtml theme, client-side validation for radio button is not
working.  I've tried both "required" and "requiredstring" but I suspect that
none will work.  The javascript code (from form-close-validation.ftl) does
this:


function validateForm_Question() {
form = document.getElementById("Question");

if (form.elements['q1']) {
field = form.elements['q1'];
var error = "Please answer q1";
if (field.value == "") {
addError(field, error);
errors = true;
}
}

Which doesn't get the actual value of the selected radio.  I can code a
workaround in form-close-validation.ftl but it seems like this would have
been solved already?




Mitch Claborn
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts 2 Client-side Validation

2008-02-27 Thread Deepak Kumar
Hello Thaminda,

In strus 2 you can validate the forms using javascript. The good thing in
strus 2 is that you don't have to write
the code for validating the form.

Code is automatically generated pease check
http://www.roseindia.net/struts/struts2/struts-2-client-side-validation-exam
ple.shtml

Thanks


-Original Message-
From: Thaminda Karunanayake [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 27, 2008 3:51 PM
To: user@struts.apache.org
Subject: Struts 2 Client-side Validation


Hi all,


Can password confirmation be validated using client side validators in
Struts 2 ...?



Thanks

Thaminda


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client Side Validation with Struts

2008-03-29 Thread Lukasz Lenart
Hi,

Could you be more specific, which Struts version? If you use onsubmit
event, you should do that like this:

onsubmit="JavaScript: return validate();"

where validate() has to return true or false.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client Side Validation with Struts

2008-03-29 Thread Asad Habib
Hello. I am using Struts 1.3.8. The issue is not one of making the
Javascript work (it is working correctly), but rather preventing a
Struts action from being called. Is this possible given that the
action of a form is a Struts action?

- Asad



On Sat, Mar 29, 2008 at 6:44 AM, Lukasz Lenart
<[EMAIL PROTECTED]> wrote:
> Hi,
>
>  Could you be more specific, which Struts version? If you use onsubmit
>  event, you should do that like this:
>
>  onsubmit="JavaScript: return validate();"
>
>  where validate() has to return true or false.
>
>
>  Regards
>  --
>  Lukasz
>
>  http://www.linkedin.com/in/lukaszlenart
>
>  -
>  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: Client Side Validation with Struts

2008-03-31 Thread Lukasz Lenart
>  Hello. I am using Struts 1.3.8. The issue is not one of making the
>  Javascript work (it is working correctly), but rather preventing a
>  Struts action from being called. Is this possible given that the
>  action of a form is a Struts action?

I'm not sure if I understand you, but all you have to do is return
true or false from your JavaScript function (as you doing), and that
will prevent a web browser to submit form and send them to a www
server. And if there be no request from web browser, there be no
action called.
Please copy/paste the web page content you had got when you started your form.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] Problems with client side validation

2007-05-30 Thread Olivier THIERRY

Hi,

I try the client side validation with Struts 2. The validation is well done,
but I have many problems :
- For each datetimepicker field in my form, I have the following Javascript
error, which displays in a pop up : "TypeError: row.cells has no properties"
- Another problem with datetimepicker fields is that the message is
displayes between the label and the input zone, while it is displayed above
for other field types (textfield, textarea, select)
- There is no validation for radio buttons !
- When I submit again the form, the validation messages are not cleared so
they are displayed twice

A link to my JSP page : http://rafb.net/p/IdtjnW49.html

A link to my XML validation file : http://rafb.net/p/i6nbmD67.html

Thanks for any help ;)

Olivier


RE: Struts 2 Client Side Validation

2007-07-12 Thread Deepak Kumar
HI,

Please check
http://www.roseindia.net/struts/struts2/struts-2-client-side-validation-exam
ple.shtml

Thanks


-Original Message-
From: Néstor Boscán [mailto:[EMAIL PROTECTED]
Sent: Friday, July 13, 2007 1:05 AM
To: user@struts.apache.org
Subject: Struts 2 Client Side Validation


Hi

I'm trying to use Struts 2 with client side validation. I would like to use
a theme that does not add any HTML to the form, fields and error messages.
I'm working with simple theme but it's not generating the JavaScript code to
do the validation and the  tag is generation 
elements.

Any ideas?

Regards,

Néstor Boscán


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2]: Client-side validation per method

2007-08-09 Thread Veronica Iturrioz
Hi, I'm trying to use client-side validation with annotations in my action 
methods. But for all methods executes the same javascript validation. I want 
different validations for different methods. 

How can I do that?
I put @SkipValidation in some methods.

thanks, Veronica


   

Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

Re: Datetimepicker and client-side validation

2008-09-12 Thread Gabriel Belingueres
There is no client side date validator in the default themes.

I added a basic one in the xhtml theme for use with the
datetimepicker; it has a hardcoded date format though (dd/MM/).

To add it, open your xhtml theme's form-close-validate.ftl file, and
as the last option add the following lines:

<#elseif validator.validatorType = "date">
if (continueValidation && field.value != null &&
field.value != "" && field.value.replace(/^\s+|\s+$/g,"").length != 0)
{
var datePicker = dojo.widget.byId(field.parentNode.id);
var value = datePicker.getDate();

<#if validator.min?exists>
var minValue =
dojo.date.parse("${validator.min?date}", {datePattern: 'dd/MM/'});
<#else>
  var minValue = null;

<#if validator.max?exists>
var maxValue =
dojo.date.parse("${validator.max?date}", {datePattern:
'dd/MM/'});;
<#else>
  var maxValue = null;


if ((minValue != null && value < minValue) ||
(maxValue != null && value > maxValue)) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation =
false;
}
}



2008/9/11 Kawczynski, David <[EMAIL PROTECTED]>:
> I am using the datetimepicker on a form with client-side validation
> enabled.
> Form submissions with a blank datetime field should result in validation
>
> being run against that field.  This is not the case -- this field is
> only
> validated on the server.  No other form field uses the dojo, and they
> are all
> validated on the client-sided correctly.  What do I have to do so the
> datetimepicker field receives client-sided validation like the other
> fields?
> (I'm using struts 2.1.2 with xwork 2.1.1)
>
> Thanks in advance,
> -dave
>
>
>
> ===
> ===
> ==THE struts.xml:
>
>   "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>  "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
> 
>  
>  
>  
>  
>  
>
> namespace="/admin/siterequest"
>   extends="struts-default">
>
>   method="save"
>   class="siterequest.SiteRequestAction">
>  /admin/siterequest/request_form_thanks.jsp
>  /admin/siterequest/request_form.jsp
>   name="failure">/admin/siterequest/request_form.jsp
>
>  
>
> 
>
>
>
> ===
> ===
> ==THE SiteRequestAction-save-validation.xml:
>
> 
>  1.0.2//EN"
>
> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>
> 
>  
>
>  true
>  "Submitter ISID" is required
>
>
>  8
>  "Submitter ISID" must be 8 characters or less
>
>  
>  
>
>  true
>  "Business Area" is required
>
>  
>  
>
>  true
>  "Project Title" is required
>
>
>  200
>  "Project Title" must be 200 characters or less
>
>  
>  
>
>  true
>  "Description" is required
>
>
>  2000
>  "Description" must be 2000 characters or less
>
>  
>  
>
>  true
>  "Site Name" is required
>
>
>  200
>  "Site Name" must be 200 characters or less
>
>  
>  
>
>  true
>  "Issue Type" is required
>
>  
>  
>
>  "Desired Release Date" is required.
>
>
>  08/01/2008
>  01/01/2030
>  Invalid "Desired Release Date"
>
>  
> 
>
>
>
> ===
> ===
> ==THE jsp page:
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
> 
> 
>  
>Change Request Submission Form
>
>
> type=&quo

Re: Client Side Validation Not Working

2008-11-18 Thread Lukasz Lenart
And the server-side validation is working? I think not, name of xml is
not as it should be - it should be
CommentAction-save_comment-validation.xml


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Client Side Validation Not Working

2008-11-18 Thread Rabin Aryal
Lukasz,

Thanks a lot. I changed the action name and then what a silly
mistake...

Rabin 


-Original Message-
From: Lukasz Lenart [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 18, 2008 10:31 AM
To: Struts Users Mailing List
Subject: Re: Client Side Validation Not Working

And the server-side validation is working? I think not, name of xml is
not as it should be - it should be
CommentAction-save_comment-validation.xml


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
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]



client side validation on included form

2007-02-21 Thread C. Adams

I have a form that I access via an action on an ajax-ish page. (Form and
results are on same page) It's working great, but I can't figure out the
validation.

The page looks like this now:




with the form looking like this:


   Between
   
   and
   
   
   



With validation false, it works great.

With validation true, I get an error "ReferenceError:
validateForm_PersonByAge is not defined" and when I look in the generated
source, there are no javascript validation methods in the source.

but if I access the PersonByAge_input.action directly, the validation
methods are there in the source.

Have I hit a "not quite ready" area of the ajax theme?

Thanks.


Re: client side validation in struts2

2011-02-15 Thread Chris Mawata
Try changing
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld" %>
to
<%@ taglib prefix="s" uri="/struts-tags" %>

Chris


On Tue, 2011-02-15 at 06:38 -0800, dasariprasad wrote:
> in clValid.jsp, i had used input page
> <%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld" %>
> 
>  
> Strut2's actions
>
>  
>  
>   
> Service Application
>   
>   
>
> 
> 
>
> 
>   
> list="{'DrivingLicence','ElectricityBill',
>  'WaterBill','InsurancePremium'}" 
>  name="service" />   
>   
>  
>  
> 
>  
> 
>  in struts.xml
> 
>  extends="struts-default">
> 
>  class="htcstruts.ClientValidAction">
> 
> 
>   /clResult.jsp
> 
> 
> 
>/clValid.jsp
> 
> 
>   
> action class is
> 
> public class ClientValidAction extends ActionSupport {
>  
>   private String applName;
>   private String service;
>   private double charges;
>   
>   private String resStr;
> 
>   private ConcurrentHashMap services;
> 
>   public ClientValidAction() {
>services = new ConcurrentHashMap();
>services.put("DrivingLicence",new Double(100.5));
>services.put("ElectricityBill",new Double(40.5));
>services.put("WaterBill",new Double(35.5));
>services.put("InsurancePremium",new Double(30.5));
>   }
> 
>   public String execute() throws Exception {
>double cost = services.get(service);
>resStr = "hello! "+applName+" Charges for "+
>  service+ " are "+cost+".Please ready to pay";
>return SUCCESS;
>   }
> 
>   public String getResStr() {
>return resStr;
>   }
> 
>   public String getApplName() {
>return applName;
>   }
>   
>   public void setApplName(String newName) {
>applName = newName;
>   }
> 
>   public String getService() {
>return service;
>   }
>   
>   public void setService(String newService) {
> service = newService;
>   }
> 
>   public double getCharges() {
>return charges;
>   }
>   
>   public void setCharges(double newCharge) {
> charges = newCharge;
>   }
> }
> 
> used a validator.xml ClientValidAction-validation.xml
> 
> 
>"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
> 
>"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>
> 
>   
> 
>
> 
>   
> 
> true
> 
> Applicant's name is required
> 
>   
> 
> 
> 
> 
> 
>  
> 
>9.99
> 
>120.0
> 
> 
>  Charges should be higher than ${minExclusive} and lessequal to
> ${maxInclusive}
>  
>
> 
>   
> 
>  
> 
>   
>  
> when i am asking the input , i am getting in browser
> 
> FreeMarker template error!
> 
> Method public java.util.List
> org.apache.struts2.components.Form.getValidators(java.lang.String) threw an
> exception when invoked on org.apache.struts2.components.Form@1be20c
> The problematic instruction:
> --
> ==> list tag.getValidators("${tagName}") as validator [on line 46, column 9
> in template/xhtml/form-close-validate.ftl]
>  in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on
> line 25, column 1 in template/xhtml/form-close.ftl]
> --
> 
> Java backtrace for programmers:
> --
> freemarker.template.TemplateModelException: Method public java.util.List
> org.apache.struts2.components.Form.getValidators(java.lang.String) threw an
> exception when invoked on org.apache.struts2.components.Form@1be20c
> at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
> at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
> at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
> at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
> at freemarker.core.Environment.visit(Environment.java:417)
> at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.MixedContent.accept(MixedContent.java:92)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.MixedContent.accept(MixedContent.java:92)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.Environment.include(Environment.java:1483)
> at freemarker.core.Include.accept(Include.java:169)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.MixedContent.accept(MixedContent.java:92)
> at freemarker.core.Environment.visit(Environment.java:210)
> at freemarker.core.Environment.process(Environment.java:190)
> at freemarker.template.Template.process(Template.java:237)
> at
> org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
> at org.apache.struts2.co

Client side validation broken when using DynaValidatorActionForm.

2004-11-25 Thread Daffin, Miles (Company IT)
Hi All,
 
Apologies if this one has already been covered (I searched the list).
 
I am using struts 1.1 with one DynaValidatorActionForm for holding data
from multiple jsp forms (wizard style reg form).
 
The server side validation works fine but the generated javascript is
broken. The name of the form validating function is taken directly from
the form name attribute in the form-validation formset (validation.xml),
and this contains '/' characters because it is the path to the relevant
action.
 
Is this a bug, or am I misusing/misunderstanding something?
 
Thanks.
 
-Miles
 
Miles Daffin
Morgan Stanley
20 Cabot Square | Canary Wharf | London E14 4QA | UK
Tel: +44 (0) 20 767 75119
[EMAIL PROTECTED]  

 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited. 
 


Problem in Client Side Validation in Struts

2004-06-05 Thread Sandip Mante




Dear Sir,
I have a problem in Client Side Validation in Struts 1.1.Actually see
what is happening and what i have done:
I have written all validdation and validation rules invalidator.xml and
valation-rule.xml.
I have given path (through plug-in tag) in struts-config file. \
I have called it in JSP's by using return validateFormName onsubmit of
the Form.
Its working properly when I left the any required (of which validation
ihave given in Validator.xml file)field blank.
But it is not working when I'm doing validation of Maxlength and 
minlength
of fields? It is not generating any error but doesn't working also. WHy 
i'm
getting such a problem.
Hope you will undersatnd it and will reply me.
Thanks and Reagrds,
Sandip Mante



  
  

  


  

  
  

  


  
  "The 
Journy has been started and the sky is limit !!!" 
"Failure always made me try harder next 
time!!!"

  

  


  Sandip K. ManteSoftware 
Engineer 
  Penta Computing Pvt. LtdShivaji 
Nagar,Pune-411004 

  [EMAIL PROTECTED] 
  

  
  
mobile: 
+919822859361 

  
  

  


  Signature powered by Plaxo
  Want a signature like 
  this?
  
Add me to your address 
book...
 
<>

Re: Client side validation for radio button

2007-10-11 Thread Martin Gainty
in your jsp head tag..

what value have you assigned to theme?

M-
- Original Message -
From: "Mitch Claborn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Thursday, October 11, 2007 5:38 PM
Subject: Client side validation for radio button


Using the xhtml theme, client-side validation for radio button is not
working.  I've tried both "required" and "requiredstring" but I suspect that
none will work.  The javascript code (from form-close-validation.ftl) does
this:


function validateForm_Question() {
form = document.getElementById("Question");

if (form.elements['q1']) {
field = form.elements['q1'];
var error = "Please answer q1";
if (field.value == "") {
addError(field, error);
errors = true;
}
}

Which doesn't get the actual value of the selected radio.  I can code a
workaround in form-close-validation.ftl but it seems like this would have
been solved already?




Mitch Claborn
[EMAIL PROTECTED]


-
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: Client side validation for radio button

2007-10-12 Thread Mitch Claborn
In this case it is the xhtml theme.  (Isn't specified in the mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 11, 2000 5:52 PM
To: Struts Users Mailing List
Subject: Re: Client side validation for radio button


in your jsp head tag..

what value have you assigned to theme?

M-
- Original Message -
From: "Mitch Claborn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Thursday, October 11, 2007 5:38 PM
Subject: Client side validation for radio button


Using the xhtml theme, client-side validation for radio button is not
working.  I've tried both "required" and "requiredstring" but I suspect that
none will work.  The javascript code (from form-close-validation.ftl) does
this:


function validateForm_Question() {
form = document.getElementById("Question");

if (form.elements['q1']) {
field = form.elements['q1'];
var error = "Please answer q1";
if (field.value == "") {
addError(field, error);
errors = true;
}
}

Which doesn't get the actual value of the selected radio.  I can code a
workaround in form-close-validation.ftl but it seems like this would have
been solved already?




Mitch Claborn
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to enable the client side validation?

2008-03-26 Thread Chen Chunwei
Hi all,

just as title

Thanks.

Talos

Reg : Client side Validation on Indexed Collection

2007-09-01 Thread kukreja sanjeev
Hi ,
I am trying to put validations on indexed collection.
  Is there any way I can have that in validation-.xml file.
  It would be great if you can  pls.throw some light on it.
   
  Thanks in advance,
  Sanjeev
   

   
-
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.

[S2] client-side validation error message duplication

2008-09-12 Thread Kawczynski, David
I'm using struts 2.1.2, and the xhtml theme to render a form.
When client-side validaiton fails, an error message is placed above the
bad input fields.
Subsequent submission attempts result in new error messages being ADDED
to the UI, but the old messages are never removed.
I need to clear out previous submission attempt's error messages before
adding current submission attempt's error messages.
I appreciate any help you can provide!
-dave
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


Re: client side validation on included form

2007-02-22 Thread C. Adams

I have found a solution to this. The good news is it is a simple
pass-through to the dojo contentpane.

changing this:




to this:

"   scriptSeparation="false" executeScripts="true" >

fixes the issue. Could the developers add a passthrough to the dojo
scriptSeparation property?


On 2/21/07, C. Adams <[EMAIL PROTECTED]> wrote:


I have a form that I access via an action on an ajax-ish page. (Form and
results are on same page) It's working great, but I can't figure out the
validation.

The page looks like this now:




with the form looking like this:


Between

and






With validation false, it works great.

With validation true, I get an error "ReferenceError:
validateForm_PersonByAge is not defined" and when I look in the generated
source, there are no javascript validation methods in the source.

but if I access the PersonByAge_input.action directly, the validation
methods are there in the source.

Have I hit a "not quite ready" area of the ajax theme?

Thanks.



Re: client side validation on included form

2007-02-22 Thread Musachy Barroso

Can you log a Jira ticket with the request?

thanks
musachy

On 2/22/07, C. Adams <[EMAIL PROTECTED]> wrote:


I have found a solution to this. The good news is it is a simple
pass-through to the dojo contentpane.

changing this:




to this:

"   scriptSeparation="false" executeScripts="true" >

fixes the issue. Could the developers add a passthrough to the dojo
scriptSeparation property?


On 2/21/07, C. Adams <[EMAIL PROTECTED]> wrote:
>
> I have a form that I access via an action on an ajax-ish page. (Form and
> results are on same page) It's working great, but I can't figure out the
> validation.
>
> The page looks like this now:
>
>  />
> 
>
> with the form looking like this:
>
> 
> Between
> 
> and
> 
> 
> 
> 
>
>
> With validation false, it works great.
>
> With validation true, I get an error "ReferenceError:
> validateForm_PersonByAge is not defined" and when I look in the
generated
> source, there are no javascript validation methods in the source.
>
> but if I access the PersonByAge_input.action directly, the validation
> methods are there in the source.
>
> Have I hit a "not quite ready" area of the ajax theme?
>
> Thanks.
>





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Struts Validator Framework: client-side validation problem

2011-09-02 Thread RajasekharReddy
I am trying to implement Client-Side Validations using struts 1.3

But server Side validations are working properly, but Client-Side
Validations are not working properly.

My code is as follows




<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
<%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">

  

LoginPage
  
  
  
  
  
  
>

 

 

 

 


  
  Click here to   SignUp  
  
  
>


--
View this message in context: 
http://struts.1045723.n5.nabble.com/Struts-Validator-Framework-client-side-validation-problem-with-submitting-buttons-tp3481073p4761399.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Client side validation broken when using DynaValidatorActionForm.

2004-11-25 Thread David G. Friedman
Miles,

Validation based on actions has that slash-in-the-name related problem.  You
can specify a name for the validation method using the html:javascript
attribute method="...".  Just be sure to change your html:form's onsubmit to
invoke that new method name.  For example:




Just use the name "validateForm" or change it to any valid JavaScript method
name of your choice.  For more details see:

http://forum.java.sun.com/thread.jspa?forumID=45&messageID=2674439&threadID=
548445
http://homepage2.nifty.com/ymagic/struts/OtherTranslate/StrutsValidator/jspt
ags-jp.html

Regards,
David

-Original Message-
From: Daffin, Miles (Company IT) [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 25, 2004 11:38 AM
To: Struts Users Mailing List
Subject: Client side validation broken when using
DynaValidatorActionForm.


Hi All,

Apologies if this one has already been covered (I searched the list).

I am using struts 1.1 with one DynaValidatorActionForm for holding data
from multiple jsp forms (wizard style reg form).

The server side validation works fine but the generated javascript is
broken. The name of the form validating function is taken directly from
the form name attribute in the form-validation formset (validation.xml),
and this contains '/' characters because it is the path to the relevant
action.

Is this a bug, or am I misusing/misunderstanding something?

Thanks.

-Miles

Miles Daffin
Morgan Stanley
20 Cabot Square | Canary Wharf | London E14 4QA | UK
Tel: +44 (0) 20 767 75119
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


NOTICE: If received in error, please destroy and notify sender.  Sender does
not waive confidentiality or privilege, and use is prohibited.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Client side validation broken when using DynaValidatorActionForm.

2004-11-26 Thread Daffin, Miles (Company IT)
David,

Many thanks.

-Miles 

> -Original Message-
> From: David G. Friedman [mailto:[EMAIL PROTECTED] 
> Sent: 25 November 2004 17:49
> To: Struts Users Mailing List
> Subject: RE: Client side validation broken when using 
> DynaValidatorActionForm.
> 
> Miles,
> 
> Validation based on actions has that slash-in-the-name 
> related problem.  You can specify a name for the validation 
> method using the html:javascript attribute method="...".  
> Just be sure to change your html:form's onsubmit to invoke 
> that new method name.  For example:
> 
>  method="validateForm" />  onsubmit="return(validateForm(this));">
> 
> Just use the name "validateForm" or change it to any valid 
> JavaScript method name of your choice.  For more details see:
> 
> http://forum.java.sun.com/thread.jspa?forumID=45&messageID=267
> 4439&threadID=
> 548445
> http://homepage2.nifty.com/ymagic/struts/OtherTranslate/Struts
> Validator/jspt
> ags-jp.html
> 
> Regards,
> David
> 
> -Original Message-
> From: Daffin, Miles (Company IT) 
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 25, 2004 11:38 AM
> To: Struts Users Mailing List
> Subject: Client side validation broken when using 
> DynaValidatorActionForm.
> 
> 
> Hi All,
> 
> Apologies if this one has already been covered (I searched the list).
> 
> I am using struts 1.1 with one DynaValidatorActionForm for 
> holding data from multiple jsp forms (wizard style reg form).
> 
> The server side validation works fine but the generated 
> javascript is broken. The name of the form validating 
> function is taken directly from the form name attribute in 
> the form-validation formset (validation.xml), and this 
> contains '/' characters because it is the path to the relevant action.
> 
> Is this a bug, or am I misusing/misunderstanding something?
> 
> Thanks.
> 
> -Miles
> 
> Miles Daffin
> Morgan Stanley
> 20 Cabot Square | Canary Wharf | London E14 4QA | UK
> Tel: +44 (0) 20 767 75119
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> 
> 
> NOTICE: If received in error, please destroy and notify 
> sender.  Sender does not waive confidentiality or privilege, 
> and use is prohibited.
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited. 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem in Client Side Validation in Struts

2004-06-05 Thread David Friedman
The form should have an onSubmit setting to
invoke that javascript function.  Have you
assured that the web page you see in the
browser:

a) has the onsubmit listing your validation form function
b) has the require() javascript function
c) has the form named javascript function
d) isn't showing any javascript error messages.

Regards,
David

-Original Message-
From: Sandip Mante [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 05, 2004 12:33 AM
To: [EMAIL PROTECTED]
Subject: Problem in Client Side Validation in Struts


Dear Sir,
I have a problem in Client Side Validation in Struts 1.1.Actually see
what is happening and what i have done:
I have written all validdation and validation rules invalidator.xml and
valation-rule.xml.
I have given path (through plug-in tag) in struts-config file. \
I have called it in JSP's by using return validateFormName onsubmit of
the Form.
Its working properly when I left the any required (of which validation
ihave given in Validator.xml file)field blank.
But it is not working when I'm doing validation of Maxlength and minlength
of fields? It is not generating any error but doesn't working also. WHy i'm
getting such a problem.
Hope you will undersatnd it and will reply me.
Thanks and Reagrds,
Sandip Mante
"The Journy has been started and the sky is limit !!!" "Failure always made
me try harder next time!!!"

Sandip K. Mante
Software Engineer Penta Computing Pvt. Ltd
Shivaji Nagar,
Pune-411004
[EMAIL PROTECTED] mobile: +919822859361




Signature powered by PlaxoWant a signature like this?

Add me to your address book...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2 client side validation and preparable interceptor?

2008-02-15 Thread jpiser

I have a couple of questions regarding the preparable interceptor:
1. By implementing the preparable interface alone I can have my prepare()
method called before my action. Great, no problem. 

But If I want to utilize multiple prepare methods, e.g. prepareInput(),
prepareCreate(), etc.. that does not work unless I add interceptors to my
action like this:


 
 
 

/pages/userMgmt/createUser.jsp
/pages/userMgmt/createUser.jsp
/pages/userMgmt/profile.jsp


however, at that point none of my client side validation works anymore in my
form in the JSP.

Can anyone explain to me why this is?  Am I missing something?  

What I am trying to do is have two JSPs, each with similiar forms that have
client side validation, that use the same action bean but call different
action methods and different prepare methods. The reason why I want to use
the same action bean is that all the parameters are the same and they are
both ultimately calling an update method that would be the same, so I do not
need two action beans that would have the same methods.

Thanks for any help you can give!

John
-- 
View this message in context: 
http://www.nabble.com/Struts-2-client-side-validation-and-preparable-interceptor--tp15502421p15502421.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to enable the client side validation?

2008-03-26 Thread Nils-Helge Garli Hegvik
http://struts.apache.org/2.x/docs/client-side-validation.html

Nils-H

On Wed, Mar 26, 2008 at 9:34 AM, Chen Chunwei
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  just as title
>
>  Thanks.
>
>  Talos

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to enable the client side validation?

2008-03-26 Thread Chen Chunwei
My struts version is 1.1. And I tried to add  in my jsp file which needs validation. But it seems 
not working.

Talos

- Original Message - 
From: "Nils-Helge Garli Hegvik" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, March 26, 2008 4:39 PM
Subject: Re: How to enable the client side validation?


http://struts.apache.org/2.x/docs/client-side-validation.html

Nils-H

On Wed, Mar 26, 2008 at 9:34 AM, Chen Chunwei
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  just as title
>
>  Thanks.
>
>  Talos

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to enable the client side validation?

2008-03-26 Thread Antonio Petrelli
2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> My struts version is 1.1. And I tried to add  formName="submitForm" /> in my jsp file which needs validation. But it seems
> not working.



See:
http://struts.apache.org/1.1/userGuide/building_view.html#validator

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Chen Chunwei
Thanks Antonio

As I said, I've already used . Of course, I've alse done the 
other stuff found in the document you refer to (offline version). But it does 
not work.

Can you give some more details of using client-side validation?

Talos

- Original Message - 
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, March 26, 2008 4:56 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> My struts version is 1.1. And I tried to add  formName="submitForm" /> in my jsp file which needs validation. But it seems
> not working.



See:
http://struts.apache.org/1.1/userGuide/building_view.html#validator

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Chen Chunwei
Well, the case is that the Javascript code was generated well, but it was not 
triggered.

Talos

- Original Message - 
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, March 26, 2008 5:10 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> As I said, I've already used . Of course, I've alse done
> the other stuff found in the document you refer to (offline version). But it
> does not work.



What exactly does not work? Give more details, for example, exceptions at
startup of the application, or the Javascript code is not generated, etc.

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Antonio Petrelli
2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> Well, the case is that the Javascript code was generated well, but it was
> not triggered.



Well, that's strange. Can you post, the generated HTML and Javascript code?
What browser are you using? Changing browser changes anything?

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Antonio Petrelli
2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> As I said, I've already used . Of course, I've alse done
> the other stuff found in the document you refer to (offline version). But it
> does not work.



What exactly does not work? Give more details, for example, exceptions at
startup of the application, or the Javascript code is not generated, etc.

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Chen Chunwei
I found the answer.

There's an attribute in  named method. You can specify a name 
in this attribute such as validateForm. Then specify the onsubmit event of the 
actual form with "return validateForm(this);". After all, the javascript works.

The above solution comes from my colleague. But I wonder know is there any 
document refer to this? Or it should be a common sense?

Talos

- Original Message - 
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, March 26, 2008 5:18 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> Well, the case is that the Javascript code was generated well, but it was
> not triggered.



Well, that's strange. Can you post, the generated HTML and Javascript code?
What browser are you using? Changing browser changes anything?

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Antonio Petrelli
2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> There's an attribute in  named method. You can specify a
> name in this attribute such as validateForm. Then specify the onsubmit event
> of the actual form with "return validateForm(this);". After all, the
> javascript works.
>
> The above solution comes from my colleague. But I wonder know is there any
> document refer to this? Or it should be a common sense?



Good catch. In fact, I think that the docs should be fixed, because also in
the draft docs there is no reference about it:
http://struts.apache.org/1.x/userGuide/building_view.html#validator

So feel free to open an issue (and provide a patch, if you can :-) ):
https://issues.apache.org/struts/browse/STR

Antonio


Re: How to enable the client side validation?

2008-03-26 Thread Chen Chunwei
Sorry for mis-typing.

>But I wonder know ...

should be 

But I wanna know...

Talos
- Original Message - 
From: "Chen Chunwei" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, March 26, 2008 5:34 PM
Subject: Re: How to enable the client side validation?


I found the answer.

There's an attribute in  named method. You can specify a name 
in this attribute such as validateForm. Then specify the onsubmit event of the 
actual form with "return validateForm(this);". After all, the javascript works.

The above solution comes from my colleague. But I wonder know is there any 
document refer to this? Or it should be a common sense?

Talos

- Original Message - 
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, March 26, 2008 5:18 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <[EMAIL PROTECTED]>:
>
> Well, the case is that the Javascript code was generated well, but it was
> not triggered.



Well, that's strange. Can you post, the generated HTML and Javascript code?
What browser are you using? Changing browser changes anything?

Antonio


Struts 2.0: Ajax based client side validation "onblur"

2008-04-10 Thread goelshek

For Struts 2.0 (NOT 2.1):

The documentation for introduction to 
http://struts.apache.org/2.0.11.1/docs/ajax-client-side-validation.html Ajax
Client Side Validation  says that "The validation occurs on each onblur
event for each form element". The 
http://struts.apache.org/2.0.11.1/docs/ajax-validation.html example   starts
off by saying that "An example is provided on how to use AJAX validation
with Prototype, in this case the Dojo plugin is not required." So I scroll
down to the bottom of the page and try to follow the Example using
Prototype. However, there are two issues I see with this example. 

Firstly, there is no onblur specified for each element. So does this example
really work for onblur? 

Secondly, even if I assume that the code for onblur will be put at runtime,
when implementing the said example, my browser tells me that it could not
find "Ajax" which is probably an object in prototype.js. Apparently the src
in the two script declarations: 

1)  

AND 

2)  

cannot be resolved. From all my searching, there has been no clue as to
where I can find these .js files. People say that they are "automagically"
put there. But even for that magic to happen, those files must be present in
the source code of struts. I searched through the entire source code and it
just does not have either of those two files. 

To conclude, I am trying to get Ajax based client side validation to work
onblur at each element (NOT onsubmit of the form; that works fine). But
there seems to be no example - not even in the showcase tutorial. If anyone
has got it to work, I would really appreciate if you could share your
example with me. 

Thanks. 

PS: In many places in the documentation I see notifications to the effect:
"This documentation refers to version 2.1 which has not been released yet."
Isn't that kind of ridiculous? Providing documentation for something that
isn't even released is something I cannot wrap my head around. If someone
can explain that concept to a novice user like myself, it would be a great
help.
-- 
View this message in context: 
http://www.nabble.com/Struts-2.0%3A-Ajax-based-client-side-validation-%22onblur%22-tp16608849p16608849.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reg : Client side Validation on Indexed Collection

2007-09-05 Thread Laurie Harper

kukreja sanjeev wrote:

Hi ,
I am trying to put validations on indexed collection.
  Is there any way I can have that in validation-.xml file.
  It would be great if you can  pls.throw some light on it.


Which version of Struts are you using? Struts 1 lets you specify 
multiple validation files in the configuration, but wont automatically 
search for per-action validation files.


Struts 2 can find validation rules in various places automatically, 
including per-action files. See 'Defining Validation Rules' in the 
validation documentation [1] for details.


L.

[1] http://struts.apache.org/2.x/docs/validation.html

ObWhine: please don't post unrelated questions to an existing thread. Be 
sure to start a new thread (with an appropriate subject) by sending a 
fresh message to the list, rather than using Reply To.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] client-side validation error message duplication

2008-09-12 Thread Dave Newton
--- On Fri, 9/12/08, Kawczynski, David wrote:
> I'm using struts 2.1.2, and the xhtml theme to render a
> form. When client-side validaiton fails, an error message
> is placed above the bad input fields.
> Subsequent submission attempts result in new error messages
> being ADDED to the UI, but the old messages are never removed.

The label code is made of fairly brittle DOM manipulation; is there anything in 
your form that might mess with the DOM (IIRC there was an issue with hidden 
fields at one point; not sure if that was resolved or not)?

The code that does all that lives in validation.js, although it's not served 
from the template directory. If you want to customize yours you need to change 
the form-validate.ftl template to use the location of your copy of 
validation.js.

(I'm writing a small blurb about this in case my client-side validation changes 
don't meet with strenuous objections, but the technique is valid even if it 
doesn't make it in to the mainline release; I'll follow up when that's done.)

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] client-side validation error message duplication

2008-09-12 Thread Pascal Lalonde
If you are using Spring into your projet, this may be related to the 
beans being singletons, we had this problem in the past, we actually 
were required to call cleanErrorsAndMessages method at each prepare call.


- Pascal

Kawczynski, David wrote:

I'm using struts 2.1.2, and the xhtml theme to render a form.
When client-side validaiton fails, an error message is placed above the
bad input fields.
Subsequent submission attempts result in new error messages being ADDED
to the UI, but the old messages are never removed.
I need to clear out previous submission attempt's error messages before
adding current submission attempt's error messages.
I appreciate any help you can provide!
-dave
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.

  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [S2] client-side validation error message duplication

2008-09-12 Thread Kawczynski, David
--- On Fri, 9/12/08, Kawczynski, David wrote:
> I'm using struts 2.1.2, and the xhtml theme to render a
> form. When client-side validaiton fails, an error message
> is placed above the bad input fields.
> Subsequent submission attempts result in new error messages
> being ADDED to the UI, but the old messages are never removed.

I found the issue.  I was being a dodo.

The struts/xhtml/validation.js file's clearErrorMessages function
contains code to retrieve the table that stores the form.  It then
iterates over the table's rows, deleting any that has an "errorFor"
attribute.  In my case, the table that is retrieved is completely empty!
It turns out that my jsp file looks like this:







Which resulted in the generated html to look like this:










The first table in the form had no rows!  Removing the empty 
elements from the jsp page fixed my issue.  I should pay more attention
when migrating from the simple theme to an xhtml theme.  :)

Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2.1.2 client side validation doesn't get generated

2008-10-28 Thread Adam Ruggles

I'm trying to get struts to spit out the client side validation code and it
doesn't seem to be working.  The backend validation is working fine but when
I use the xhtml theme with the , the script code under the form is
not being generated.

Looking at the code it looks like it's failing this check
"parameters.performValidation?default(false) == true" in the
form-close-validate.ftl file.  What would cause the performValidation not to
be set as true?

I'm using annotations to markup my action.

public class TestAction extends ActionSupport {
private String username, email, password, password2;

@Override
public String execute() {
return SUCCESS;
}
public String save() {
// Do stuff and return SUCCESS ...
}
@RequiredStringValidator(message = "Required Field.", key =
"validation.required")
@EmailValidator(message = "Enter a valid email.", key = 
"validation.email")
public String getEmail() {
return email;
}

@RequiredStringValidator(message = "Required Field.", key =
"validation.required")
@StringLengthFieldValidator(trim = true, minLength = "3" , maxLength =
"16",
message = "Must be between ${minLength} and 
${maxLength}.", key =
"validation.length")
public String getPassword() {
return password;
}

@FieldExpressionValidator(expression = "password2.equals(password)",
message = "Passwords do not match.", key = 
"validation.match.passwords")
@RequiredStringValidator(message = "Required Field.", key =
"validation.required")
public String getPassword2() {
return password2;
}

@RequiredStringValidator(message = "Required Field.", key =
"validation.required")
@StringLengthFieldValidator(trim = true, minLength = "3" , maxLength =
"16",
message = "Must be between ${minLength} and 
${maxLength}.", key =
"validation.length")
public String getUsername() {
return username;
}

public void setEmail(final String email) {
this.email = email;
}

public void setPassword(final String password) {
this.password = password;
}

public void setPassword2(final String password2) {
this.password2 = password2;
}

public void setUsername(final String username) {
this.username = username;
}
}

here is my form code:








struts.xml
















/WEB-INF/pages/index.jsp


        /WEB-INF/pages/success.jsp
/WEB-INF/pages/index.jsp
/WEB-INF/pages/error/default.jsp




-- 
View this message in context: 
http://www.nabble.com/Struts-2.1.2-client-side-validation-doesn%27t-get-generated-tp20221161p20221161.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



controlling error message placement for client side validation

2009-08-22 Thread Mitch Claborn
css_xhtml theme.  Using server-side validation, the error message for
field validation is placed above the input field.  Using client side,
the error message is shown below.  I prefer the messages above.  Is
there a way to force the client-side validation to put the messages
above the input field?
Sample code below.




  
  

  First Name
  

  
  




Mitch



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts Validator Framework: client-side validation problem

2011-09-02 Thread Dave Newton
What happens? What do you expect to happen? What's your validation config?
We need something beyond "it doesn't work".

Dave
 On Sep 2, 2011 3:47 AM, "RajasekharReddy"  wrote:
> I am trying to implement Client-Side Validations using struts 1.3
>
> But server Side validations are working properly, but Client-Side
> Validations are not working properly.
>
> My code is as follows
>
>
>
>
> <%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
> <%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN">
> 
> 
> 
> LoginPage
> 
>
> 
> 
> 
>
> >
> 
>  
> 
>  
>
>  
> 
>  
> 
> 
> 
> Click here to    href="SignUp.jsp">SignUp 
> 
> 
> >
>
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/Struts-Validator-Framework-client-side-validation-problem-with-submitting-buttons-tp3481073p4761399.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>


Re: Struts Validator Framework: client-side validation problem

2011-09-02 Thread Brian Thompson
I'm not familiar with the  tag; does that auto-include the script
defining the validateForm() function?

If not, I'd suggest a missing 

Possible client side validation bug in Struts 2.3.15

2013-07-03 Thread Bruno Klava
Hi folks,

after upgrading Struts from 2.3.14.3 to 2.3.15 my client side form
validation stopped working. More specifically, the code to validate
requiredstring is not being generated in the validateForm_xx()
functions.

Is anybody having the same issue?

Tnx in advance,
Bruno


Client Side Validation using a pure JSF Only Application

2004-09-28 Thread babloosony
Hi All,

There is a pure web application that uses only jsf as model, view,
controller. How do we achieve a reusable client-side validations
framework likes Struts's validator framework ?

Any ideas on how we do a clientside validation in a pure jsf application ?


Thanks & Regards,
Kumar.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Multiple ActionForms on a page - client side validation possible?

2004-04-20 Thread Berke, Wayne [IT]
Hi,

I have a page that logically subdivides into 3 independent HTML forms and I've 
subsequently planned on using 3 different ValidatorForms for each.  There seems to be 
no problem in configuring validations for each form's fields and having those 
validations trigger from the server side.  However, I seem to be running into problems 
when trying to activiate client side validation via multiple html:javascript tags.  To 
simplify things, I've only configured two ActionForms each of which has a property 
that uses the "required" validator.  The tags in my JSP (in the HTML ) look like 
this:





The problem seems to be that each of the dynamic JS tags emits a required() method 
that is not name-specific to its form.  This results in the second such definition 
being the only one that is visible from the entire page.  Therefore, the form2 does 
correctly perform client-side validation for its required field whereas form1 does not.

Is there a correct way to make this work?  Merging everything into one big unwieldy 
form would work, but would make the data structures unmanageable.

Wayne

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2: client side validation message kept displaying repeatedly

2008-01-07 Thread Cheng Wei Lee
I enabled client side validation for a form, when the user submits, the
validation kicks in and the messages are shown. If the user didn't make any
changes and proceed to submit again, the set messages are shown again. The
messages kept increasing. Is there a way to clear the old messages before
showing the new ones?


Re: Struts 2 client side validation and preparable interceptor?

2008-02-15 Thread Laurie Harper

jpiser wrote:

I have a couple of questions regarding the preparable interceptor:
1. By implementing the preparable interface alone I can have my prepare()
method called before my action. Great, no problem. 


But If I want to utilize multiple prepare methods, e.g. prepareInput(),
prepareCreate(), etc.. that does not work unless I add interceptors to my
action like this:


Hmm, I haven't done that but I thought the prepare interceptor could do 
this without messing with the interceptor stack. Are you sure you need 
to do this?




 
 
 

/pages/userMgmt/createUser.jsp
/pages/userMgmt/createUser.jsp
/pages/userMgmt/profile.jsp


however, at that point none of my client side validation works anymore in my
form in the JSP.

Can anyone explain to me why this is?  Am I missing something?  


Probably basicStack doesn't include some of the interceptors that need 
to be there for client side validation to work. When you specify 
interceptors on an action like that, you override the set of 
interceptors that would otherwise be applied.


Have you tried replacing the interceptor-ref elements with a single 
reference to the paramsPrepareParams stack, or changing the final one to 
reference defaultStack instead of basicStack?


L.


What I am trying to do is have two JSPs, each with similiar forms that have
client side validation, that use the same action bean but call different
action methods and different prepare methods. The reason why I want to use
the same action bean is that all the parameters are the same and they are
both ultimately calling an update method that would be the same, so I do not
need two action beans that would have the same methods.

Thanks for any help you can give!

John



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2.0: Ajax based client side validation "onblur"

2008-04-10 Thread Musachy Barroso
The page that you are refering to is for 2.1, as stated on the top of
the page. The reason why the documentation is all mixed together wit
"2.1" warnings on some pages is because we don't have branches on the
wiki (or separate wikis) for different versions, as I mentioned on
another thread.

regards
musachy

On Thu, Apr 10, 2008 at 2:38 PM, goelshek <[EMAIL PROTECTED]> wrote:
>
>  For Struts 2.0 (NOT 2.1):
>
>  The documentation for introduction to
>  http://struts.apache.org/2.0.11.1/docs/ajax-client-side-validation.html Ajax
>  Client Side Validation  says that "The validation occurs on each onblur
>  event for each form element". The
>  http://struts.apache.org/2.0.11.1/docs/ajax-validation.html example   starts
>  off by saying that "An example is provided on how to use AJAX validation
>  with Prototype, in this case the Dojo plugin is not required." So I scroll
>  down to the bottom of the page and try to follow the Example using
>  Prototype. However, there are two issues I see with this example.
>
>  Firstly, there is no onblur specified for each element. So does this example
>  really work for onblur?
>
>  Secondly, even if I assume that the code for onblur will be put at runtime,
>  when implementing the said example, my browser tells me that it could not
>  find "Ajax" which is probably an object in prototype.js. Apparently the src
>  in the two script declarations:
>
>  1)   src="${pageContext.request.contextPath}/struts/utils.js"
>  type="text/javascript">
>
>  AND
>
>  2)   type="text/javascript">
>
>  cannot be resolved. From all my searching, there has been no clue as to
>  where I can find these .js files. People say that they are "automagically"
>  put there. But even for that magic to happen, those files must be present in
>  the source code of struts. I searched through the entire source code and it
>  just does not have either of those two files.
>
>  To conclude, I am trying to get Ajax based client side validation to work
>  onblur at each element (NOT onsubmit of the form; that works fine). But
>  there seems to be no example - not even in the showcase tutorial. If anyone
>  has got it to work, I would really appreciate if you could share your
>  example with me.
>
>  Thanks.
>
>  PS: In many places in the documentation I see notifications to the effect:
>  "This documentation refers to version 2.1 which has not been released yet."
>  Isn't that kind of ridiculous? Providing documentation for something that
>  isn't even released is something I cannot wrap my head around. If someone
>  can explain that concept to a novice user like myself, it would be a great
>  help.
>  --
>  View this message in context: 
> http://www.nabble.com/Struts-2.0%3A-Ajax-based-client-side-validation-%22onblur%22-tp16608849p16608849.html
>  Sent from the Struts - User mailing list archive at Nabble.com.
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



struts 2 client side validation with JBoss (portal server)

2007-08-28 Thread Gervai, Tamas (GE Money, consultant)
Hello,

I tried to use client side validation on my portal (portlet) with struts 2.

It seems to me, that struts 2 just failed to generate client side validation 
JavaScript. My question is, is this a known bug, known defect or it should not 
work anyway?

It seems just the JavaScript from the end of the JSP is missing. Server side 
validation just work fine.

The same application (project) work fine under Tomcat. 

Does anyone succeed with client side validation under portlet? 
-- 
tamas


Re: Struts 2.1.2 client side validation doesn't get generated

2008-10-29 Thread Adam Ruggles

Anyone?  The server side validation works fine, when I post the form it comes
back with the correct validation but the client side is not being generated
because the performValidation is being set to false.

The obvious work around is to edit the form-close-validate.ftl and remove
(parameters.performValidation?default(false) == true), but why does this
performValidation there?  Especially since the form-validate doesn't make
the same check and generates the return function.

-- 
View this message in context: 
http://www.nabble.com/Struts-2.1.2-client-side-validation-doesn%27t-get-generated-tp20221161p20240335.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2.1.2 client side validation doesn't get generated

2008-10-29 Thread Adam Ruggles

It looks like this is a Google Guice issue.  When I swapped the guice plugin
for the spring plugin everything worked as expected.
-- 
View this message in context: 
http://www.nabble.com/Struts-2.1.2-client-side-validation-doesn%27t-get-generated-tp20221161p20240986.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



client side validation does not appear to be working

2008-11-19 Thread vineet semwal
hellos,
i am using struts 2.1.2 with codebehind plugin ,i cant make client side
validation working with validation annotations in my project though i have
tried
 them succesfully in small examples. i am confused if i am hitting any issue
in my configuration in project due to any other plugin.
I am attaching my pom.xml and a small action class and a jsp





thanks and regards
Vineet
http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
  4.0.0
  aplomb.jobfinder
  jobfinder
  pom
  1.0-SNAPSHOT
  jobfinder
  http://maven.apache.org
  
  

 


 
ibibilo
Java hibernate Repository for Maven 2
http://www.ibiblio.org/maven
default





Maven Plugin Repository
http://struts2plugin-maven-repo.googlecode.com/svn/trunk/

  false


  true





mvnrepository.com
Java hibernate Repository for Maven 2
http://mvnrepository.com/
default




java.net repo
jta download
http://download.java.net/maven/2
default








  struts2.1.2-staging
  Struts 2.1.2 staging repository
  default
  http://people.apache.org/builds/struts/2.1.2/m2-staging-repository/
  
false
  









   
org.apache.maven.plugins  
maven-compiler-plugin 
  
 1.6 
 1.6  
  
 
 
org.apache.maven.plugins
maven-surefire-report-plugin
2.4.2
  

  



   org.apache.maven.plugins
   maven-surefire-plugin
   2.4.2
   
 
   src/test/resources/testng.xml
 
   






	
	
	



log4j
log4j
1.2.12
test


org.slf4j
slf4j-log4j12
1.4.2




org.testng
testng
5.8
test
jdk15



mysql
mysql-connector-java
5.0.5
test






			org.hibernate
			hibernate
			3.3.1.GA



asm
asm


asm
asm-attrs


cglib
cglib




		


asm
asm
2.2.3


javassist
javassist
3.8.0.GA
 
 

cglib
cglib-nodep
2.1_3


		
			org.hibernate
			hibernate-annotations
			3.4.0.GA
		
		


 
org.springframework
spring
2.5.5



  
org.springframework
spring-aspects
2.5.5






opensymphony
ognl
2.6.11




org.apache.struts
struts2-dojo-plugin
2.1.2





org.apache.struts
struts2-core
2.1.2




org.apache.struts
struts2-codebehind-plugin
2.1.2






org.apache.struts
struts2-spring-plugin
2.1.2





   com.googlecode
   jsonplugin
   0.30
   






commons-fileupload
commons-fileupload
1.1.1
 
 




core
web

	



package aplomb.jobfinder.web.jobsearch;

import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results;



import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.Validation;
import com.opensymphony.xwork2.validator.annotations.Validations;
import com.opensymphony.xwork2.validator.annotations.ValidatorType;



@Results(
		{
@Result(name="SUCCESS", value="/common/jobsearch/Test.jsp" ),


@Result(name="input", value="/common/jobsearch/TestOne.jsp")

})
	
	//@Validation()

public class TestOneAction {
	String one;
	@RequiredStringValidator( message = "one field cant be blank",fieldName="one")
	@StringLengthFieldValidator( trim = true, minLength="2" , maxLength = "12",
	fieldName = "one",message = "one should be of minimum 2 letters")
	public String getOne() {
		return one;
	}
	
	
	public void setOne(String one) {
		this.one = one;
	}
	
	 
	/*
	@Validations(
	requiredFields =
	[EMAIL PROTECTED](type = ValidatorType.SIMPLE,
			fieldName = "one", message = "You must enter a value for field.")
			})*/
	
	   
	public String execute()
	{
		System.out.println("-inside execute---");

		


	return "SUCCESS";
}
	

}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Need help in client side validation in Struts 2.0

2007-04-18 Thread arunabh

hi,
If somebody have some information about client side validation in Stutrs2. 0
then send me .I am in a desperate need  of the same .
thanks
 Arunabh  
-- 
View this message in context: 
http://www.nabble.com/Need-help-in-client-side-validation-in-Struts-2.0-tf3605223.html#a10072395
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Possible client side validation bug in Struts 2.3.15

2013-07-03 Thread Maurizio Cucchiara
Hi Bruno,
could you provide a code sample?

Twitter :http://www.twitter.com/m_cucchiara
G+  :https://plus.google.com/107903711540963855921
Linkedin:http://www.linkedin.com/in/mauriziocucchiara
VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara

Maurizio Cucchiara


On 3 July 2013 21:09, Bruno Klava  wrote:

> Hi folks,
>
> after upgrading Struts from 2.3.14.3 to 2.3.15 my client side form
> validation stopped working. More specifically, the code to validate
> requiredstring is not being generated in the validateForm_xx()
> functions.
>
> Is anybody having the same issue?
>
> Tnx in advance,
> Bruno
>


Re: Possible client side validation bug in Struts 2.3.15

2013-07-04 Thread Bruno Klava
Hi Maurizio,

is was generating a minimal example but could not reproduce the bug in it.
It must be something else, maybe a customized template/component.

tnx anyway ;)
Bruno


On Wed, Jul 3, 2013 at 4:20 PM, Maurizio Cucchiara wrote:

> Hi Bruno,
> could you provide a code sample?
>
> Twitter :http://www.twitter.com/m_cucchiara
> G+  :https://plus.google.com/107903711540963855921
> Linkedin:http://www.linkedin.com/in/mauriziocucchiara
> VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara
>
> Maurizio Cucchiara
>
>
> On 3 July 2013 21:09, Bruno Klava  wrote:
>
> > Hi folks,
> >
> > after upgrading Struts from 2.3.14.3 to 2.3.15 my client side form
> > validation stopped working. More specifically, the code to validate
> > requiredstring is not being generated in the validateForm_xx()
> > functions.
> >
> > Is anybody having the same issue?
> >
> > Tnx in advance,
> > Bruno
> >
>



-- 
Bruno Klava


Re: Possible client side validation bug in Struts 2.3.15

2013-07-05 Thread Bruno Klava
Now I managed to create a minimal example that reproduces the error (the
previous example I was trying was too minimal :)

https://github.com/bklava/struts

In the example, in the index action/page, there are 2 forms: the difference
is that the form 1 submits to the action without setting a method (then
calling the default execute() method), while the form 2 submits to the same
action but calling a specific method.

The validator is set annotating the field setter method, so it should be
available either to the default execute method and to the non-default
method. This is exactly the behaviour obtained when using Struts 2.3.14.3.

After switching to Struts 2.3.15, the form 2 validation is not executed at
all.

As far as I can tell, this difference is due to changes made
in org.apache.struts2.components.Form.getValidators(String name)

If you need any further info, just ask.

Tnx!
Bruno


On Thu, Jul 4, 2013 at 4:25 PM, Bruno Klava  wrote:

> Hi Maurizio,
>
> is was generating a minimal example but could not reproduce the bug in it.
> It must be something else, maybe a customized template/component.
>
> tnx anyway ;)
> Bruno
>
>
> On Wed, Jul 3, 2013 at 4:20 PM, Maurizio Cucchiara 
> wrote:
>
>> Hi Bruno,
>> could you provide a code sample?
>>
>> Twitter :http://www.twitter.com/m_cucchiara
>> G+  :https://plus.google.com/107903711540963855921
>> Linkedin:http://www.linkedin.com/in/mauriziocucchiara
>> VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara
>>
>> Maurizio Cucchiara
>>
>>
>> On 3 July 2013 21:09, Bruno Klava  wrote:
>>
>> > Hi folks,
>> >
>> > after upgrading Struts from 2.3.14.3 to 2.3.15 my client side form
>> > validation stopped working. More specifically, the code to validate
>> > requiredstring is not being generated in the validateForm_xx()
>> > functions.
>> >
>> > Is anybody having the same issue?
>> >
>> > Tnx in advance,
>> > Bruno
>> >
>>
>
>
>
> --
> Bruno Klava
>



-- 
Bruno Klava


Re: Possible client side validation bug in Struts 2.3.15

2013-07-10 Thread Lukasz Lenart
2013/7/5 Bruno Klava :
> As far as I can tell, this difference is due to changes made
> in org.apache.struts2.components.Form.getValidators(String name)

I would say that now is ok and previously it was a bug ;-) But you are
right, that breaks backward compatibility


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Possible client side validation bug in Struts 2.3.15

2013-07-10 Thread Lukasz Lenart
2013/7/10 Lukasz Lenart :
> 2013/7/5 Bruno Klava :
>> As far as I can tell, this difference is due to changes made
>> in org.apache.struts2.components.Form.getValidators(String name)
>
> I would say that now is ok and previously it was a bug ;-) But you are
> right, that breaks backward compatibility

Could you register an issue with link to the example?


Thanks in advance
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Possible client side validation bug in Struts 2.3.15

2013-07-10 Thread Alireza Fattahi
Hi,

I get these two warnings:
2013-07-10 16:42:45,683  WARN 
(com.opensymphony.xwork2.interceptor.ParametersInterceptor:56) - Parameter 
[struts.enableJSONValidation] is on the excludeParams list of patterns!


2013-07-10 16:42:45,683  WARN 
(com.opensymphony.xwork2.interceptor.ParametersInterceptor:56) - Parameter 
[struts.validateOnly] is on the excludeParams list of patterns!

How can I fix it ?!
I put below in struts.xml
    

But it did not help.


 
~Regards,
~~Alireza Fattahi

Re: Possible client side validation bug in Struts 2.3.15

2013-07-11 Thread Bruno Klava
Issue created: https://issues.apache.org/jira/browse/WW-4139


On Wed, Jul 10, 2013 at 6:18 AM, Lukasz Lenart wrote:

> 2013/7/10 Lukasz Lenart :
> > 2013/7/5 Bruno Klava :
> >> As far as I can tell, this difference is due to changes made
> >> in org.apache.struts2.components.Form.getValidators(String name)
> >
> > I would say that now is ok and previously it was a bug ;-) But you are
> > right, that breaks backward compatibility
>
> Could you register an issue with link to the example?
>
>
> Thanks in advance
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Bruno Klava


Re: Possible client side validation bug in Struts 2.3.15

2013-07-11 Thread Lukasz Lenart
Solved, please check with the latest build ... hm ... ale the build are gone :\

https://builds.apache.org/view/S-Z/view/Struts/


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/7/11 Bruno Klava :
> Issue created: https://issues.apache.org/jira/browse/WW-4139
>
>
> On Wed, Jul 10, 2013 at 6:18 AM, Lukasz Lenart wrote:
>
>> 2013/7/10 Lukasz Lenart :
>> > 2013/7/5 Bruno Klava :
>> >> As far as I can tell, this difference is due to changes made
>> >> in org.apache.struts2.components.Form.getValidators(String name)
>> >
>> > I would say that now is ok and previously it was a bug ;-) But you are
>> > right, that breaks backward compatibility
>>
>> Could you register an issue with link to the example?
>>
>>
>> Thanks in advance
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
> --
> Bruno Klava

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



  1   2   >