File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes TextField Readonly issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "TextField Readonly issue" Watch "TextField Readonly issue" New topic

TextField Readonly issue

sudharshan tettu
Ranch Hand

Joined: Jul 17, 2006
Posts: 126

I m taking one text field as readonly and setting its value from javascript.(value is not null)

When the form is submitted ,the value of the text field is passed as null
but not the value
am using struts tags ...
could any one help me how to sort out this issue
Thanks in advance
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

This question isn't making a lot of sense.
If you're having trouble with English, posting the relevant parts of your code would be a big help.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
There is a difference between READONLY and DISABLED (Google for more info on it). Which one are you using? Probably the latter. A disabled field is not sent when the form is submitted.

So much trouble in the world -- Bob Marley
rahul khanna
Ranch Hand

Joined: Sep 14, 2005
Posts: 48
If the field is disabled, what you can do is create an extra hidden field and store the value in the hidden field as well. You can then read it from the ActionForm.
I agree. Here's the link:
subject: TextField Readonly issue
jQuery in Action, 3rd edition