How do you return a value in a checkbox?

I've got a series of Yes/No  fields and I want to allow the user to see which ones are checked. I've tried a couple things and I've decided to ask the experts. Here's what I've got:

set RSList = conn.execute("select * from inv order by make")

When I get to my checkboxes how do I reflect the "True" value?

<input type="checkbox" name="Powersteering" value="<% response.write RSList("PowerSteering") %>">

There's no error on the page, but no check mark either.

What do you think?
brucegustPHP DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PerfunctionCommented:
I think this is what you need:

http://www.apycom.com/drop-down-menu/ex11.html
0
brucegustPHP DeveloperAuthor Commented:
No...

I'm not looking for the user to manually check the box. I need VBScript to look at the database and insert a checkmark into the checkbox where the status is "True".
0
hesCommented:
Use checked=True not value=

<input type="checkbox" name="Powersteering" checked="<% response.write RSList("PowerSteering") %>">
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

brucegustPHP DeveloperAuthor Commented:
hes

We're on the threshold of greatness, my friend, but I'm still missing something.

When I introduced your code:

<input type="checkbox" name="Powersteering" checked="<% response.write RSList("PowerSteering") %>">


Every auto was displayed as having power steering which isn't the case. In other words, not every car has Power Steering, yet every Power Steering box is checked.

What...?
0
jwbeckCommented:
I don't know if this is the most efficient way of doing it, but what I will typically do is write out one of two lines of HTML for the corresponding Checkbox element like this:

<input type="checkbox" name="Powersteering" <%If RSList("PowerSteering") = True Then Response.Write "CHECKED">

Doing it this way should at least display the checkboxes on the screen poperly. Saving the data back to the database would have to be handled separately.

Hope this helps.

0
jwbeckCommented:
Syntax correction:

<input type="checkbox" name="Powersteering" <%If RSList("PowerSteering") = True Then Response.Write "CHECKED"%>>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brucegustPHP DeveloperAuthor Commented:
That got it!

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.