[Javascript] Re: Checkbox

Michael J. Mahony igby at mediaone.net
Wed Feb 6 07:24:11 CST 2002


Just add this:

<input type="Checkbox" name="select" value="checkbox" checked="Yes" 
onChange="forceChecked()">

Then in your script area put this function:

forceChecked()
{
document.form.select.checked = True;
} 

However, if you are requiring that this value be set to yes, why not just put it in a hidden 
field with the value set?  Why tease the user into thinking they can uncheck something 
you won't allow them to uncheck?

On 6 Feb 2002 at 9:25, phumes1 wrote:

> 
> Hi,
> 
> Is there a way to force a checkbox and not allow the user to "uncheck" it?
> 
> <input type="Checkbox" name="select" value="checkbox" checked="Yes" 
> required="Yes">
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript

Michael J. Mahony

John 3:16 -- 
    For God so loved the world, that He gave His only begotten Son, 
    that whoever believes may in Him have eternal life. 





More information about the Javascript mailing list