aspose file tools*
The moose likes Struts and the fly likes struts client side validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts client side validation" Watch "struts client side validation" New topic
Author

struts client side validation

vishal Mestri
Greenhorn

Joined: Sep 05, 2012
Posts: 14
Hi All,

I have gone through struts validator framework.
Currently we have to implement only client side validation using struts validator framework in our project.

We have requirement where we have one drop down with values YES and NO. When I select YES , then one text box is displayed and in this case only, contents of textbox becomes mandatory.
If I select NO, then contents of textbox is not mandatory.

I think , requiredif or validwhen can resolve my problem.

I have checked in struts documentation but it does not clearly specify , whether they are server side and which are client side validations [amongst the available in struts validator framework]

Further I checked below mentioned sites , which say that requiredif or validwhen are server side validations.
http://www.theserverside.com/discussions/thread.tss?thread_id=36950
http://mail-archives.apache.org/mod_mbox/struts-user/200604.mbox/%3C5F1761E7ABCC1B4C93A78CE3ECA1C8D50A1E57@essex01.ess.com%3E

Thus kindly help me on how to do client side validation which involves dependency.

I am using struts 1.2.7 version.

Regards,
Vishal
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

Refer to this Topic Validation using javascript


Learning some thing New Every Day
vishal Mestri
Greenhorn

Joined: Sep 05, 2012
Posts: 14
Hi Yogesh lonkar,

Thanks for your prompt response. Really appreciate , you took time out.

But sorry to say, my question is not answered.

As I want to implement dependency validations in client side javascript validation using Struts validator framework only..

Yesterday I searched on google and recommendation which I concluded is writing custom validation is way out.
Below mentioned in URL which I got.
http://www.raibledesigns.com/rd/date/20030226#struts_validator_validating_two_fields

Can someone confirm me whether , I am right track. or I am re-writing code, for which already components available in validator framework.

Just want to highlight again, My Objective is to achieve dependency validation through client side javascript validation through struts validator framework only.

Regards,
Vishal
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

I am not sure what you actually want but here is LINK for struts2 validation framework tutorial. it will give you basic introduction to validations in struts2. I hope this is what you are looking for.
vishal Mestri
Greenhorn

Joined: Sep 05, 2012
Posts: 14
Hi Yogesh,

I am using struts 1.2.7 version. Currently , I can not upgrade due to some internal reasons.

I wanted dependency(if i select YES in one drop down , then only other text box becomes mandatory.Otherwise not.) client side validations through struts validator framework





Regards,
Vishal
vishal Mestri
Greenhorn

Joined: Sep 05, 2012
Posts: 14
Hi All,

I was able to create custom validations using existing javascript functions.
Still I am awaiting if any master has already coded for the same in struts.

Thanks and Regards,
Vishal
vishal Mestri
Greenhorn

Joined: Sep 05, 2012
Posts: 14
Hi All,

Please someone kindly confirm whether I am on right track by reading above posts.
I am afraid that , I am coding for stuff which is might be already available in struts.

Thanks and Regards,
Vishal
 
 
subject: struts client side validation