Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    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.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •