Programmed Under The Influence
Bike Crash (Surprise) Squirrel!!
(Original image from: http://www.rofl.name/)

Bike Crash (Surprise) Squirrel!!

(Original image from: http://www.rofl.name/)
Nuclear (Surprise) Squirrel!!
(Original image from: http://science.howstuffworks.com/)

Nuclear (Surprise) Squirrel!!

(Original image from: http://science.howstuffworks.com/)
Surprise Squirrel!! (at least that’s what I call him)
(Source: http://www.telegraph.co.uk/news/newstopics/howaboutthat/6018173/Squirrel-is-surprise-star-of-holiday-photo.html)

5 flavors of voting. Choose which one best suits your survey.

Run out of options? No problem, click ‘Another Option?’
This jQuery plugin lets you easily create new fields with the click of a button (granted you are okay with using <table>s.) It’s easy to integrate and fairly customizable.
Appendo courtesy of Deep Liquid

Run out of options? No problem, click ‘Another Option?’

This jQuery plugin lets you easily create new fields with the click of a button (granted you are okay with using <table>s.) It’s easy to integrate and fairly customizable.

Appendo courtesy of Deep Liquid

Finishing up the survey voting and results pages.

Basically this is what the site will be about. Surveying decisions that you and your friends have to make on a daily basis. What movie should we go to? Where should we eat? What types of food should we bring to a get-together?

Commenting… you’re doing it right :D

These are two examples of my new commenting system:

  • What!? No Way! (in alpha)
  • Pollacio.us (coming shortly)
Posting checkbox values with PHP and jQuery

For some time I had trouble figuring out how to post checkbox results using jQuery’s $.post function after submitting a form. I searched many different sites finding pieces of the a solution that would fit my needs.
Anyway here’s what I got:

1) Let’s create a simple form.

    <form id="my_form" onsubmit="return processForm()">
        1) <input type="checkbox" class="option" name="options[]" value="1" /><br />
        2) <input type="checkbox" class="option" name="options[]" value="2" /><br />
        3) <input type="checkbox" class="option" name="options[]" value="3" /><br />
        <input type="submit" value="Submit" />
    </form>

2) Create the javascript to handle the form submission.

    function processForm() {
        var options = $('#my_form :input.option');
        var option_array = new Array();
        
        $.each(options, function(index, element) {
            if ($(element).is(':checked')) {
                option_array.push($(element).val());
            }
    
        // Post options to action file
        $.post('/your/path/to/action/file.php', {'options[]': option_array});
        
        return false;
    }

3) Handle the form submission using PHP.

    <?php
        foreach ($_POST['options'] as $option) {
            /* Do whatever you want with your options here. */
        }
        
        // Or you can just print the results to the screen for test purposes
        print_r($_POST);
        exit;
    ?>

…never code without it.
Courtesy of Remy Sharp

New site on the horizon…

I am almost proud to present my latest site.
I am very close to wrapping it up, but I think it will be another week of perfecting it and making sure all the screws are tightened.

Here are some screen captures for a teaser:

Login Form (Header)
Login Form

Register Form
Register Form

Survey Overview
Survey Overview

Voting Booth
Voting Booth