SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jan 2011
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Backend PHP Check list code echo ed in Front End.

    I would like to know if there are any tutorials about the following thing that i would like to do.
    I would like to add in my back end control panel of my software source a checklist that when i check a checkbox to be echoed in the front end of the store, and when i uncheck it, the option to disappear in the front end.
    How can i do this?

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    265
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    Maybe with JavaScript, something like this:
    Code:
    <form action="script.php" method="post">
     <div id="sel" style="display:none;">Select: <select name="sel">
      <option value="v1">v1</option>
      <option value="v2">v2</option>
      <option value="v3">v3</option>
     </select></div>
     Checkbox: <input type="checkbox" name="chb" id="chb" onclick="getSel(this)" /><br/>
     <input type="submit" name="submit" value="Send" />
    </form>
    <script type="text/javascript"><!--
    // JavaScript Course: www.coursesweb.net/javascript/
    function getSel(chb) {
      if(chb.checked == true) document.getElementById('sel').style.display = 'block';
      else document.getElementById('sel').style.display = 'none';
    }
    //-->
    </script>
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners


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
  •