From: Evertjan. on 22 Mar 2010 06:42 Adrienne Boswell wrote on 22 mrt 2010 in microsoft.public.inetserver.asp.general: > if checked = "1" then 'notice the " on either side of the 1 > checked = true > else > checked = false > end if > Agreeing with all you wrote, Adrienne, I still think even a beginner should know that testing for true/false this way is a bit of code overkill, so I would do: checked = checked = "1" Morover, because I'm to lazy to remember what the browser will return, [my Chrome returns "on", I just found], I check for the absence of this supposed trueness: checked = checked <> "" ========= test.asp ========== Returned text: <% = request.querystring("myCheckbox") %> <hr> Testing for "1": <% = request.querystring("myCheckbox")="1" %> <hr> Testing for "on": <% = request.querystring("myCheckbox")="on" %> <hr> Testing for not "": <% = request.querystring("myCheckbox")<>"" %> <hr> <form> <input type='checkbox' name='myCheckbox' checked> <input type='submit'> </form> ============================= This returns if checked and submitted: Returned text: on Testing for "1": False Testing for "on": True Testing for not "": True -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
From: MikeR on 22 Mar 2010 08:44 mikezx10(a)hotmail.com wrote: > Ok I have not read all the msg yet but this is my 1st post ever and > also i inherited this code. so what is top posting? Top posting is putting your replies on top of the stuff you're replying to, instead of after it. Mike
First
|
Prev
|
Pages: 1 2 Prev: Shared Session Next: use an anchor to submit, or set image for submit button |