Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Make Checkbox group Non-Editable

 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Can anybody told me how to make checkbox group non-editable.
I have a view option in my project so i don't want user to modify that checkbox group which i had already selected.
I had tried out with this "readonly=true" and "onfocus=blur()",but it will not work out.
Thanx
sanjay patel
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really a HTML question, so I've moved it.
 
bill bozeman
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The onblur() will work with text boxes, but not radio buttons or check boxes. I believe that this is because to make the radio button get focus, you click on it, and when you click on a radio button, it changes that value. So it is the order of events on the radio buttons and checkboxes that is screwing that up. Works nice on text fields though.
There is not an inactive flag for radio buttons or check boxes, so you really can't do this. My suggestion would be to create an image of a checkbox, one checked, and one not checked, and then have some server side processing that displays the correct image from the form that was submitted. You can then put all the real values in hidden fields, so you can submit them form from that page also. You don't have to use images either, and just use straight HTML text to say what is checked, but the images might give it a nice look.
Bill
[This message has been edited by bill bozeman (edited November 27, 2000).]
 
David Rizzi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might try something like this:
<form action="whatever" method="post">
<input name="cb1" type="checkbox" onclick="forms(0).cb1.checked=defaultChecked">
</form>
-David
Originally posted by Sanjay pts:
Hello
Can anybody told me how to make checkbox group non-editable.
I have a view option in my project so i don't want user to modify that checkbox group which i had already selected.
I had tried out with this "readonly=true" and "onfocus=blur()",but it will not work out.
Thanx
sanjay patel

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic