i want to make a text field readonly in html form written in my servlet

Then don't make a textfield. Simply place the value on the page, and if a value for that field still needs to returned by the form, add a hidden value with the name that textfield normally would have had.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.