Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Validation based on Database results

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am using Struts Framework. I have 2 JSPs "Page1.jsp" & "Page2.jsp".
On submitting Page1.jsp, i am getting the data from the database into <html:text> controls in Page2.jsp.

For instance,
I have 2 fields NAME & ADDRESS in Page2.jsp. Value for NAME is obtained from database & ADDRESS is empty.
I would like to perform the following:
If NAME is not null then NAME should be disabled & ADDRESS should get the focus.
If NAME is null then NAME should be enabled.

How can i do this ???
I am using Struts Validator for validations.
Thnks in advance....
[ April 18, 2006: Message edited by: Shailesh Pillai ]
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi shailesh,

u can use sturts logic tags to solve ur problem

ie u check for null using either notEmpty or equals or notEquals and accordingly u write the html:text entries with property "disabled" set to true so that the textfield will be disabled

hope my clue works out for u
 
Shailesh Pillai
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks satish for ur suggestion. Let me check it out.
 
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic