• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Struts client side validations

Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The application I am working on has a mix of client and server side struts validations.
I recently added a few fields to the application which display or hide based on the selection of other values.
Ex: A text box displays or hides based on whether the state is selected as Georgia or not.
I am unable to validate this text box client side.
Can a field be set to required or not based on the value in another field and validations be performed client side?
I want this to be validated client side as if the server side validations fail, the previously displayed field goes back to being hidden as it was when the page loaded first.

Thanks in advance.
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rahul,

I can answer how to hide the field if the state selected is Georgia.

You can check the selected state like document.getElementById().value== Georgia then you can hide the particualr field with display style.

Hope this answer your question and Chances of failing Script validation are more than server side validation.

I think I'll just lie down here for a second. And ponder this tiny ad:
how do I do my own kindle-like thing - without amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!