• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Make Checkbox group Non-Editable

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is really a HTML question, so I've moved it.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
What are your superhero powers? Go ahead and try them on this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic