PDA

View Full Version : Checkbox problem


cbrundage
11-09-2009, 05:56 PM
Someone helped make an asp form but I can't get the checkboxes to return a "Yes". This checkbox can have several boxes checked. Here is my html for one of the 6 boxes -

<input type=checkbox name="checkbox671" value="clip their claws" id="checkbox671"><font face="Verdana" size="2" color="#000000"><label for="checkbox671">I will clip their claws</label></font><br>c

In form.asp is the following for that item -

checkbox671: <input name="checkbox671" type="checkbox" id="checkbox671">

And in process.asp is

MyBody = MyBody & "Clip claws: "& checkbox671 & vbcrlf

I would greatly appreciate any help - I am familiar with html but not asp.

Christina

Old Pedant
11-09-2009, 06:51 PM
If you want a value of "Yes", then give the checkbox value="Yes".

You gave it value="clip their claws" so that's what you will get.

But I don't pretend to understand the rest of your code or question.

First you give the HTML for that checkbox.
Then you give what you *SAY* is ASP for the *SAME CHECKBOX*. But:
-- it's not ASP code, it's just HTML
-- it doesn't look at all like the HTML from the first part.

So I, for one, can make no sense of this.

Maybe you need to post more code???

cbrundage
11-09-2009, 09:28 PM
I'll withdraw my question. I don't seem knowledgeable enough for this forum. Thanks anyway.

Old Pedant
11-10-2009, 12:13 AM
All I was asking for is that you give us more code and explain what you are doing more.

If you read more into what I wrote than that, I apologize, but really that's all that was intended.

I really and truly couldn't make sense of what you wrote. Honest.

I don't at all get why you have the same checkbox in two different sets of HTML with two very different formats.

In this code:
<input type=checkbox name="checkbox671" value="clip their claws" id="checkbox671">
If you read that checkbox on the next page (I assume an ASP page) via
value = Request("checkbox671")

then you will indeed get the value clip their claws if the checkbox was checked before the <form> was submitted.

But in this code:
<input name="checkbox671" type="checkbox" id="checkbox671">
with the same ASP reading that, you would get the value on if it is checked (because that is the default value of a checkbox when you omit the value= from the HTML.

So, to reiterate what I said the first time, you don't have any case where you assign value="Yes" to a checkbox, and so there is no way you will ever get "Yes" from doing
value = Request("checkbox671")


You also show this ASP code:
MyBody = MyBody & "Clip claws: "& checkbox671 & vbcrlf

But you don't show where you got that variable, checkbox671 from. Did you indeed code
checkbox671 = Request("checkbox671")
?? I would assume so, but when you don't show us the code it's purely a guess.

And are you aware that if a checkbox is *not* checked before the <form> is submitted, then it will have no value whatsoever that is accessible on the submitted-to page??

In short, all I really wanted you to do was show some more code, so we can try to figure out (a) what you are doing and (b) maybe what you are doing wrong. I'm sorry, but the little snippets of code you posted just don't tell me anywhere near enough to understand your question.

When I said I can't make sense of your post, I was not saying that the question didn't make sense or that the problem doesn't make sense. I was only and truly only saying that there is simply not enough information there to even really guess at an answer. Nothing more.