Re: Struts validation problem

2008-03-01 Thread Anet
Hi.
  Thank you very much Dave. my problem solved. 
   
  Anet.

Dave Newton <[EMAIL PROTECTED]> wrote:
  --- Anet wrote:
> whats your mean about rendering tag property? 

It ate part of my text; I was asking if it renders a  tag.
If not, you'd have to put it inside one--I just don't remember much about S1
any more.

> everything is ok. just validation doesn't work. 

I think we have different definitions of "ok".

Dave


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



   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Struts validation problem

2008-02-27 Thread Dave Newton
--- Anet <[EMAIL PROTECTED]> wrote:
>   whats your mean about rendering tag property? 

It ate part of my text; I was asking if it renders a  tag.
If not, you'd have to put it inside one--I just don't remember much about S1
any more.

>   everything is ok. just validation doesn't work. 

I think we have different definitions of "ok".

Dave


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



Re: Struts validation problem

2008-02-27 Thread Anet
Hi Dave;
  whats your mean about rendering tag property? 
  everything is ok. just validation doesn't work. 
I use struts 1.1 . 
  
Dave Newton <[EMAIL PROTECTED]> wrote:
  --- Anet wrote:
> I have an strange problem with struts validation. Everything is ok.

...

> but java script created by struts are shown on top of my page, where I put 
> 

Is it rendering the tag properly? Which version of S1 are you
using?

Dave


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



   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: Struts validation problem

2008-02-27 Thread Dave Newton
--- Anet <[EMAIL PROTECTED]> wrote:
>   I have an strange problem with struts validation. Everything is ok.

...

> but java script created by struts are shown on top of my page, where I put 
> 

Is it rendering the  tag properly? Which version of S1 are you
using?

Dave


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



Struts validation problem

2008-02-27 Thread Anet
Hi
   
  I have an strange problem with struts validation. Everything is ok. I checked 
it several times.
but java script created by struts are shown on top of my page, where I put 

  any idea?
   
  Thanks.

   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: struts validation problem

2007-07-23 Thread Paul Benedict

Nosinov,

The feature to display the error value in a validation message is part 
of the next release of Validator (1.4). At the moment, no current 
releases allow this feature. If you want, you can help submit a patch 
for that feature:

https://issues.apache.org/jira/browse/VALIDATOR

Paul

Nosinov Mirbek wrote:

Hello Everybody.
Could you help me with Struts validation.

this is block from validation.xml

   

   

I want to show in error message in jsp value of property email, that user has 
entered.
like if user entered [EMAIL PROTECTED]
i want to show error message
[EMAIL PROTECTED] is invalid

-
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 validation problem

2007-07-23 Thread Nosinov Mirbek
Hello Everybody.
Could you help me with Struts validation.

this is block from validation.xml

   

   

I want to show in error message in jsp value of property email, that user has 
entered.
like if user entered [EMAIL PROTECTED]
i want to show error message
[EMAIL PROTECTED] is invalid

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



Re: struts validation problem

2006-04-10 Thread Madhav Bhargava
As a quick fix i changed the validator-rules.xml file. I added the
following:

*if (field == undefined) {*
*   isValid = true;*
} else if { 
}

I did this for required and mask rules. This solved the problem for me.

Thanks for your response. Moreover with the version of validator framework i
am using i doubt there is *validwhen* available. I need to double check
that.

~madhav



On 4/10/06, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> Madhav Bhargava wrote:
> > Hi All,
> >
> > I am using Struts 1.0 and struts-validator 1.0.
> > I have a JSP which has 3 tabs. Each tab body has a different 
> element
> > inside it. I am using Ajax to dynamically generate the tab body content.
> >
> > Let me take an example and explain it. Assume there are 2 tabs - Tab1
> and
> > Tab2.
> > *Controls in Tab1: *a text field - t1
> > *Controls in Tab2:* a single select drop down - s1
> > At any time either the text field is present on the form or a single
> select
> > drop down.
> >
> > In my validation.xml i have validation rules specified for both of these
> > controls.
> > *Extract from validation.xml*
> >
> > 
> >
> >  >   "-//Apache Software Foundation//DTD Commons Validator Rules
> > Configuration 1.0//EN"
> >   "/WEB-INF/config/dtd/validator_1_0.dtd">
> >
> > 
> > 
> > 
> >  depends="required,minlength">
> > 
> >  > "minlength" resource="false" />
> > 
> > minlength
> > 2
> > 
> > 
> > 
> >  name="mask" />
> > 
> > 
> > mask
> > ^[0-9]+$
> > 
> > 
> > 
> > 
> > 
> > When the form is submitted then client side validation occurs using
> > validation.xml and "An error on page" comes up on the botton left corner
> of
> > the web page indicating that there has been an error. The processing
> does
> > not stop but the error is displayed.
> >
> > The problem is that i am unable to create a rule in validation.xml which
> > will only validate a control if it is present on the generated web page.
> >
> > *Question:*  Is there any way in which it can be specified that only if
> the
> > control is there then validate it else ignore the rule? I guess this
> problem
> > must be faced by other people as well.
> >
> > One option will be: Do client side validations using Javascript
> functions
> > and do server side validations using validation.xml/defer till you hit
> > action and do it explicitely there. But if i have to use
> struts-validator
> > framework for client side validations as well then what will the
> solution?
>
> The validation framework has no way to know the difference between 'the
> control wasn't present on the page' and 'no value was submitted for the
> control' so no, there's no way to tell it to only apply a validation
> when the control is 'there'.
>
> One possibility would be to express your validation constraints with
> validwhen and use a hidden input or something to decide what rules to
> apply.
>
> But a better approach may be to leverage the validation framework's
> 'wizard' support. That allows you to specify a 'page' key on each
> validation rule to control when it's applied. You would need to figure
> out how to map the currently displayed tab to a page key for the
> validator to look at, but that would probably give you a fairly clean
> solution.
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do


Re: struts validation problem

2006-04-09 Thread Laurie Harper

Madhav Bhargava wrote:

Hi All,

I am using Struts 1.0 and struts-validator 1.0.
I have a JSP which has 3 tabs. Each tab body has a different  element
inside it. I am using Ajax to dynamically generate the tab body content.

Let me take an example and explain it. Assume there are 2 tabs - Tab1 and
Tab2.
*Controls in Tab1: *a text field - t1
*Controls in Tab2:* a single select drop down - s1
At any time either the text field is present on the form or a single select
drop down.

In my validation.xml i have validation rules specified for both of these
controls.
*Extract from validation.xml*












minlength
2






mask
^[0-9]+$





When the form is submitted then client side validation occurs using
validation.xml and "An error on page" comes up on the botton left corner of
the web page indicating that there has been an error. The processing does
not stop but the error is displayed.

The problem is that i am unable to create a rule in validation.xml which
will only validate a control if it is present on the generated web page.

*Question:*  Is there any way in which it can be specified that only if the
control is there then validate it else ignore the rule? I guess this problem
must be faced by other people as well.

One option will be: Do client side validations using Javascript functions
and do server side validations using validation.xml/defer till you hit
action and do it explicitely there. But if i have to use struts-validator
framework for client side validations as well then what will the solution?


The validation framework has no way to know the difference between 'the 
control wasn't present on the page' and 'no value was submitted for the 
control' so no, there's no way to tell it to only apply a validation 
when the control is 'there'.


One possibility would be to express your validation constraints with 
validwhen and use a hidden input or something to decide what rules to 
apply.


But a better approach may be to leverage the validation framework's 
'wizard' support. That allows you to specify a 'page' key on each 
validation rule to control when it's applied. You would need to figure 
out how to map the currently displayed tab to a page key for the 
validator to look at, but that would probably give you a fairly clean 
solution.


L.


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



struts validation problem

2006-04-07 Thread Madhav Bhargava
Hi All,

I am using Struts 1.0 and struts-validator 1.0.
I have a JSP which has 3 tabs. Each tab body has a different  element
inside it. I am using Ajax to dynamically generate the tab body content.

Let me take an example and explain it. Assume there are 2 tabs - Tab1 and
Tab2.
*Controls in Tab1: *a text field - t1
*Controls in Tab2:* a single select drop down - s1
At any time either the text field is present on the form or a single select
drop down.

In my validation.xml i have validation rules specified for both of these
controls.
*Extract from validation.xml*












minlength
2






mask
^[0-9]+$





When the form is submitted then client side validation occurs using
validation.xml and "An error on page" comes up on the botton left corner of
the web page indicating that there has been an error. The processing does
not stop but the error is displayed.

The problem is that i am unable to create a rule in validation.xml which
will only validate a control if it is present on the generated web page.

*Question:*  Is there any way in which it can be specified that only if the
control is there then validate it else ignore the rule? I guess this problem
must be faced by other people as well.

One option will be: Do client side validations using Javascript functions
and do server side validations using validation.xml/defer till you hit
action and do it explicitely there. But if i have to use struts-validator
framework for client side validations as well then what will the solution?

~Madhav

--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do