SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML_Quickform2 checkbox

    As a beginner to OOP and PEAR I can create a checkbox using this code
    Code PHP:
    $fieldset->addElement('checkbox', 'boxname', array('id' => 'test', 'value' => 'value'))
    but how do I create the same checkbox so that the default is already checked?

  2. #2
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Try this and see if it works:

    $fieldset->addElement('checkbox', 'boxname', array('id' => 'test', 'value' => 'value', 'checked' => 'checked));


Bookmarks

Posting Permissions

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