• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Read only Form

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there some way to make a form read only using struts or some other way. I don't want to keep duplicate copies, one for Read only and other editable. Any input in this direction will be greatly appreciated.

Thanks
Vicky
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try consulting:

http://jakarta.apache.org/struts/userGuide/struts-html.html#text

the answer will jump right out at you.
 
vicky kumar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,
This is at the field level. I'm wndering if there is some way to make a form read only at the form level. This would avoid maitianing 2 copies of the form.

Can we do something in javascript. I mean, what if I iterate through all the elements of the form in javascript and disable them all.

Can any one else has a better idea ?

Cheers
Vicky
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
vicki,
<%
String readOnly = "";
if(formIsReadOnly){ // however you plan on checking this
readOnly = "readonly='readonly'";
}
%>
<html:text property="shtuff" <%= readOnly %> />
<html:text property="moreShtuff" <%= readOnly %> />
...
 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic