un highlight check box value

hello,

I want to un highlight check box value , that i can see but i can't click. i used :

out.println("<input type=\"checkbox\" name=\"option\" value=\"" + query + "\" checked disabled=\"true\" >");

but the problem that when i try to read the option value it is null. when i remove disabled="true" the option value it is not null but the check box can be clicked.

it might be other command except disabled

any help

[460 byte] By [farag_ahmed@yahoo.coma] at [2007-11-27 9:00:39]
# 1
make it "readonly", not "disabled"
gimbal2a at 2007-7-12 21:29:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
it is still not working, i still can click on the check boxi tryedout.println("<input type=\"checkbox\"name=\"option\" value=\"" + query + "\" checked readonly=\"true\" >");any help
farag_ahmed@yahoo.coma at 2007-7-12 21:29:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Its simple farag!!!

if u are making a check box "disabled", it will not send any value back to Servlet.

It is the same with all form elements like text box, radio.....etc

For the code below..

out.println("<input type=\"checkbox\" name=\"option\" value=\"" + query + "\" checked disabled=\"true\" >");

if the code in bold is present then create a hidden variable with the same name - option and send its value back to servlet..

Something like this!!

out.println("<input type=\"hidden\" name=\"option\" value=\"" + query + "\" >");

This should be there only if the chkbox is checked and disabled!!

vinayak_ra at 2007-7-12 21:29:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
one more thing - u cant make a chkbox READONLY. it has to be either enabled or disabled
vinayak_ra at 2007-7-12 21:29:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
thanks my friend it is very good solution :)
farag_ahmed@yahoo.coma at 2007-7-12 21:29:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...