Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-24-2012, 02:23 PM   PM User | #1
Iggy0828
New Coder

 
Join Date: Sep 2012
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
Iggy0828 is an unknown quantity at this point
editing using an html form and php

I am building a webapp for a development project using mysql and php. I am currently trying to build an editing page. I'm running into a problem pulling checkboxes. I have two sets of them that are used on data entry and I need to pull that info into an editing page. Every thing I have tried either makes them always unchecked or always checked.

Code:
<br><input type="checkbox" name="earslot" checked="<? echo $row['earslot']; ?>" /><br>
That is currently always checked. The value used in the data entry segment = 1 when checked.
Iggy0828 is offline   Reply With Quote
Old 09-24-2012, 02:40 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
checked="<? echo $row['earslot']; ?>"
To get a checkbox checked, you need to apply an attribute checked="checked" to that element. If you remove that entire attribute and value, it'll become unchecked.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 PM.


Advertisement
Log in to turn off these ads.