Ask a Question related to ASP Database, Design and Development.
-
Maria Kovacs #1
problem retrieving value from DB into a checkbox
I am very new to ASP/DB, so please bear with me.
In my "add data" form, through checkboxes I am entering "Yes" values.
(no "No" values, those are blank)
Each checkbox equals a coloumn in my DB, if checked it places "Yes" as
a value, if left unchecked it has no value. ( I know...I did not use
Yes/No fields)
In my "update form" I am trying to retrieve the earlier entered "Yes"
values into checkboxes, but I can't seem to get anything.
I tried all kinds of variations of this line, this is the latest:
<input name="Badges_Buttons" value="<% If
Request.Form("Badges_Buttons") = "Yes" Then Response.Write ("checked")
%>" type="checkbox" size="30" maxlength="30">Badges & Buttons<br>
What am I doing wrong?
Thanks.
M
Maria Kovacs Guest
-
Problem retrieving data from SQL Server
I am a newbie to both SQL Server and webservices. I have mostly done programing in Foxpro, VB6, and a little C++, and VB.net. I have been able to... -
PHP problem retrieving data
I'm not sure why this isn't working, but it's giving me no output. I have a form which requests email and city to pull up a listing, then Email that... -
[PHP] retrieving form checkbox values
This is not necessary, you can do foreach($_POST as $file) { // ... } George Pitcher wrote: -
retrieving form checkbox values
I have a form which I want to post multiple values from one function to another using checkboxes. Having one value is simple- the form submits the... -
Problem Retrieving data from an SQL Query in ASP
You can create a table variable inside your code and insert the data from the cursor into it. Finally, return the table variable back to your ASP.... -
Ray at #2
Re: problem retrieving value from DB into a checkbox
I didn't fully follow your explanation, but the one thing I noticed is that
if your condition is true, you're going to wind up with:
<input name="Badges_Buttons" value="checked" type="checkbox" size="30"
maxlength="30">Badges & Buttons<br>
Notice that you have
value="checked"
It should be
value="whatever the value should be" checked
So, try
<input name="Badges_Buttons" value="something"<% If
Request.Form("Badges_Buttons") = "Yes" Then Response.Write (" checked")%>"
type="checkbox" size="30" maxlength="30">Badges & Buttons<br>
Maxlength for a checkbox?
Ray at home
"Maria Kovacs" <mariakovacs@lycos.com> wrote in message
news:6f76be22.0309241229.7cdc2d78@posting.google.c om...> I am very new to ASP/DB, so please bear with me.
>
> In my "add data" form, through checkboxes I am entering "Yes" values.
> (no "No" values, those are blank)
>
> Each checkbox equals a coloumn in my DB, if checked it places "Yes" as
> a value, if left unchecked it has no value. ( I know...I did not use
> Yes/No fields)
>
> In my "update form" I am trying to retrieve the earlier entered "Yes"
> values into checkboxes, but I can't seem to get anything.
>
> I tried all kinds of variations of this line, this is the latest:
>
> <input name="Badges_Buttons" value="<% If
> Request.Form("Badges_Buttons") = "Yes" Then Response.Write ("checked")
> %>" type="checkbox" size="30" maxlength="30">Badges & Buttons<br>
>
> What am I doing wrong?
>
> Thanks.
> M
Ray at Guest
-
Maria Kovacs #3
Re: problem retrieving value from DB into a checkbox
Sorry for the hazy explanation. All I am trying to do is retrieve
information for editing from a coloumn that contains the value "Yes"
and display it in a checkbox.
You were right about the maxlength, that stayed there from an earlier
version I tried for text.
So now my code looks like this, and it still does not work:
<input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then
Response.Write ("checked")%> type="checkbox">
Maria Kovacs Guest
-
Maria Kovacs #4
Re: problem retrieving value from DB into a checkbox
where "Toys" is name of the field
and "Yes" is value, entered according whether the supplier carried toys or not.
Maria Kovacs Guest
-
Maria Kovacs #5
Re: problem retrieving value from DB into a checkbox
Sorry for the hazy explanation. All I am trying to do is to retrieve
information for editing from a field (say: Toys) and display it into a
checkbox. If the supplier carried toys the field value is "Yes" if it
doesn't carry doys the field doesn't contain anything.
Following your advice, now my code looks like this but my checkboxes
are still empty:
<input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then
Response.Write("checked")%> type="checkbox"> Toys</font></td>
Maria Kovacs Guest
-
Maria Kovacs #6
Re: problem retrieving value from DB into a checkbox
Still don't work:
<input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then
Response.Write ("checked")%> type="checkbox">Toys</font></td>
(Sorry if I may multiple posted but my posts don't seem to appear in
the thread.)
Maria Kovacs Guest
-
Ray at #7
Re: problem retrieving value from DB into a checkbox
What datatype is this Toys column in your Access database? I believe you
said that it is NOT a "yes/no" datatype, correct? Let's find out what the
value is --- oh, wait, you're pulling from request.form. Sorry.
So like, the value of this checkbox will only be "Yes" if you have already
checked the box and submitted the form back to itself, you realize, right?
If you do that, it should work as you have it. Try loading this page,
checking the box, and submitting the form.
testpage.asp:
<html><body>
<form method="post" action="testpage.asp">
<input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then
Response.Write ("checked")%> type="checkbox">
<input type="submit">
</form>
</body></html>
Ray at work
"Maria Kovacs" <mariakovacs@lycos.com> wrote in message
news:6f76be22.0309250729.5f3468dd@posting.google.c om...> Sorry for the hazy explanation. All I am trying to do is retrieve
> information for editing from a coloumn that contains the value "Yes"
> and display it in a checkbox.
> You were right about the maxlength, that stayed there from an earlier
> version I tried for text.
>
> So now my code looks like this, and it still does not work:
>
> <input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then
> Response.Write ("checked")%> type="checkbox">
Ray at Guest
-
Ray at #8
Re: problem retrieving value from DB into a checkbox
That's okay. MS's news server has been a bit choppy the past couple of
days. I imagine that they're trying to filter out and prevent all those
virus posting.
Ray at work
"Maria Kovacs" <mariakovacs@lycos.com> wrote in message
news:6f76be22.0309250825.64365b85@posting.google.c om...> Still don't work:
> <input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then
> Response.Write ("checked")%> type="checkbox">Toys</font></td>
>
> (Sorry if I may multiple posted but my posts don't seem to appear in
> the thread.)
Ray at Guest
-
Maria Kovacs #9
Re: problem retrieving value from DB into a checkbox
I finally got it working. As you pointed out, the problem was with the
Request.Form. I was retrieving info from the form and not from the
database. So replacing that with rsVIPP solved my problem. Here is the
code, and it flies :)
<input name="Toys" value="Yes" <% If rsVIPP("Toys") = "Yes" Then
Response.Write ("checked")%> type="checkbox">Toys
Thanks for your help.
M
Maria Kovacs Guest



Reply With Quote

