Click to See Complete Forum and Search --> : Blurring input field in Servlet.


prince
04-12-2005, 10:46 PM
Hi,

I am just puzzled with this situation where i am populating form fields in a servlet form data base and when the same is displayed to user he can choose values from it and fill the other columns. However the displayed values are coming as input values from servlet and remains active this should be deactivated or blurred to safeguard its accidental tempering by user. How can i disable it ?

Any suggestions to solve this will be highly appreciated.

thanks.

buntine
04-12-2005, 11:15 PM
You might want to look into a javasctipt or HTML solution. To disable a field in JavaScript, you can use the following:

document.getElementById('formFieldID').disabled = true;

Regards.

ray326
04-13-2005, 12:30 AM
You shouldn't be writing HTML with a servlet. You should be putting the values into a bean and passing that bean to a JSP to do the HTML. The bean could indicate which values are output and which are input or, more commonly, the JSP would be hard coded to support that process.