[Javascript] How to prevent user from selecting in select box

davecline at onebox.com davecline at onebox.com
Wed Mar 31 16:14:21 CST 2004


Put a hidden input and code to populate it from any selection by the select box. Disable the select but populate the hidden prior to submission with the desired value from the select.


-- 
Dave Cline
davecline at onebox.com
www.bangeye.com/




-----Original Message-----
From:     Chris T <christ at saeweb.com>
Sent:     Wed, 31 Mar 2004 09:39:22 -0500
To:       "[JavaScript List]" <javascript at LaTech.edu>
Subject:  Re: [Javascript] How to prevent user from selecting in select box

Or one possibility is to set it back to it's initial value on the onChange
event and alert the user.

Chris Tifer

----- Original Message ----- 
From: "Håkan Magnusson" <hakan at backbase.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Wednesday, March 31, 2004 8:06 AM
Subject: Re: [Javascript] How to prevent user from selecting in select box


> Sorry, readonly will not work.
>
> How about returning false on both onfocus and onchange?
>
> I'm too busy trying anything out myself, just pitching in a few ides.
>
> Regards,
> H
>
> Antony Paul wrote:
>
> > Hi all,
> >     I have a select box which is dynamically generated for editing the
data.
> > Based on a condition it has to be disabled. If I use the disabled
attribute
> > it won't submit the value of the select box and I have to display the
data.
> > I tried onfocus and onclick. But it is not working. Any solutions will
be
> > appreciated. I need some way to avert the selection.
> >
> > Antony Paul
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> >
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list