A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Sep 29, 2006
Jan 25, 2010 06:59:28
How can i make a html-el:checkbox readonly? I cannot make it "disabled" because like this it's not read from the form.
Joined: Aug 03, 2008
Jan 25, 2010 23:42:08
What is this
tag?? Are you using any special tag library?? Anyways, there are a lot of ways of doing this. You can actually disable the checkbox and just before the form is submitted, you can enable it again. Something like this
<form action="whatever" onsubmit="document.getElementById('mycheckbox').disabled=false;"> <input type="checkbox" checked="checked" disabled="disabled" id="mycheckbox" /> Wow <input type="submit" /> </form>
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
It is sorta covered in the
JavaRanch Style Guide
subject: html-el:checkbox readonly?
how to make a link readonly?
Setting a Component readonly Dynamically
DynaActionForm properties not correctly set with checkboxes
textfield readonly ?
non-editable in textarea
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015