How to test if cgi checkbox is set? 
Author Message
 How to test if cgi checkbox is set?

What is the proper way to test if a checkbox field is set?

The html is <input type="checkbox" name="cb_phonelist"
value="phonelist" checked>

When I try cgi["cb_phonelist"], I get a zero-length array no matter
the state of the checkbox. Same for cgi["phonelist"]. Same for
cgi.params["cb_phonelist"] and cgi.params["phonelist"]



Tue, 04 Jan 2005 08:37:54 GMT  
 How to test if cgi checkbox is set?

Quote:

> What is the proper way to test if a checkbox field is set?

> The html is <input type="checkbox" name="cb_phonelist"
> value="phonelist" checked>

> When I try cgi["cb_phonelist"], I get a zero-length array no matter
> the state of the checkbox. Same for cgi["phonelist"]. Same for
> cgi.params["cb_phonelist"] and cgi.params["phonelist"]

this shoud work. i don't see anything wrong with it. i've been using
integers for my value attributes. have you tired that just to see? lets
see, some other guesses. is the tag between <form> </form>? have you
jacked with the cgi code at all and inadvertently altered something?
that's all i can thing of off the top. "cb_phonelist" should work as the
hash index.

~transami

--
~transami

  _(")_  dobee dobee do...
   \v/  
   ^ ^



Tue, 04 Jan 2005 12:15:33 GMT  
 How to test if cgi checkbox is set?

Quote:


> > What is the proper way to test if a checkbox field is set?

> > The html is <input type="checkbox" name="cb_phonelist"
> > value="phonelist" checked>

> > When I try cgi["cb_phonelist"], I get a zero-length array no matter
> > the state of the checkbox. Same for cgi["phonelist"]. Same for
> > cgi.params["cb_phonelist"] and cgi.params["phonelist"]

> this shoud work. i don't see anything wrong with it. i've been using
> integers for my value attributes. have you tired that just to see?

That was it. Thanks.


Wed, 05 Jan 2005 00:51:04 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie: Checkboxes & CGI

2. win32com InternetExplorer checkbox set?

3. Will setting $test change $_REQUEST['test']

4. What Problems Am I Setting Myself Up For???

5. how to compile and a set of .prg file I am getting this warning

6. I am having problems setting the page break through Active X

7. Testing ODBC, what am I missing?

8. the Web IS a _computer_, HTML its language (and a pushy Scheme CGI setting it off)

9. Setting include_path for CGI PHP

10. setting REMOTE_USER CGI env. var

11. setting up wikit for CGI ?

12. Help setting CGI Environment Variables

 

 
Powered by phpBB® Forum Software