www.webdeveloper.com
Results 1 to 2 of 2

Thread: Select Checkbox Executes Code

  1. #1
    Join Date
    Jul 2008
    Posts
    38

    Select Checkbox Executes Code

    Currently, I have a bunch of checkboxes and a submit button. When the submit button is checked, my php code runs. I'm wondering if there is a way so that when a checkbox is clicked on, a php script runs?

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,434

    Lightbulb Consider this ...

    Will this work for you?
    PHP Code:
    <html>
    <
    head>
    <
    title>CBox Execute</title>
    <
    script type="text/javascript">
    function GoTo(
    info) {
      
    window.location info;
    }
    </script>
    </head>
    <body>
    <h1>Checkbox Execution</h1>
    <input type="checkbox"  value="http://www.google.com" onclick="if (this.checked) {GoTo(this.value)}">Google
    <input type="checkbox"  value="http://www.yahoo.com" onclick="if (this.checked) {GoTo(this.value)}">Yahoo
    <input type="checkbox"  value="http://www.webdeveloper.com" onclick="if (this.checked) {GoTo(this.value)}">WDev Forum
    <input type="checkbox"  value="http://www.codingforums.com" onclick="if (this.checked) {GoTo(this.value)}">Coding Forum
    </body>
    </html> 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles