• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:text + struts + disable/readOnly problem

 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am using struts html:text tag. when I am using

document.forms[0].myTextBoxProp.disabled=true;
or
document.forms[0].myTextBoxProp.readOnly=true;
document.forms[0].myTextBoxProp.readonly=true;


(note the font change for letter 'o').
The textbox field is neither disabled nor readonly( text box value is still being editable)

Any trciks or advises?

Thanks in advance to all the repsonders....
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
something that you might try is using the logic tag and having a boolean value that you can change between editable and non-editable, and having 2 different possible sets of display info.
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Knibbas. I thought of doing that and trying to know is there any mistake I am doing, before I go for a round about method.

I hope what you suggested is the only way.

The tags some times make our coding miserable.

Thanks again and enjoy your ' Thanks Giving' holiday.( Hope you are in USA)
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Puthriah Sarma:
Thanks Knibbs. I thought of doing that and trying to know is there any mistake I am doing, before I go for a round about method.

I hope what you suggested is the only way.

The tags some times make our coding miserable.

Thanks again and enjoy your ' Thanks Giving' holiday.( Hope you are in USA)
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again and enjoy your ' Thanks Giving' holiday.( Hope you are in USA)


No but thanks for the well wishing.

Hope it all works out for you.
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hereunder I am pasting the code that worked for me. This may be useful for other folks.

This may be a horrible way to do when there are more fields. But I found this as the only solution.

Any better thoughts are welcome..


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic