Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make a text box readonly

 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am developing an application in struts 1.x

i want to declare one o textbox as readonly & to fix a value in it like this


if i update to

then my textbox is not readonly

please help me

thank you
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i print the value of id then its correct according to my table
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this help?
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your reply but i have found another method to display it

but still i would like to ell you that in struts it will give an error
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aditi,

Could you please clarify, why it will give error? Because if it allows you to write scriplets, whats wrong in using a java method inside that?
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sure swastik
i can explain you uptil where i understand


i think struts tag library donot accept the default value which we have specified in my first post for this problem only i have mentioned the root cause error

please check it

thank you
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Aditi, I don't know much about struts, but if it does not accept default values, then how come this was working in your case
value=""
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't this anything is wrong with the setValue method, it does exist, only thing is it is expecting a String, not an int. So my logic should have worked as well.

You may wish to go through the api doc.

http://struts.apache.org/1.0.2/api/org/apache/struts/taglib/html/BaseInputTag.html#value
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanks swastik

for the reply might be that is the reason you have specified for my form not taking the default value

thanks

 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you successful in your readonly textbox ? if not then try this one readonly="true"
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply but this is also not working i have tried it alreay

thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic