Results 1 to 4 of 4

Thread: Poll widget/tutorial?

  1. #1
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Poll widget/tutorial?

    I need a teeny tiny little poll in the sidebar of my website. Just two radio buttons, which when submitted show two sliding scales. 25% Yes, 75% No, that sort of thing.

    I've found a lot of hugely complex ways to do this, with dozens of xml, js, css, php, blah blah blah files to download and trawl through. Is there no simplified version or tutorial out there that shows pared-down, no-frills, code?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You need some type of server side language for a poll. Javascript alone cannot store and retrieve the data necessary to keep track of things. In fact, a poll that doesn't rely on javascript is best, so it can be available to users without javascript enabled. Generally a good poll setup will use javascript only as an enhancement if at all. You may be able to find a third party add on that could simplify things somewhat and that will do the data base part using its servers:

    http://www.google.com/search?hl=en&c...22&btnG=Search
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I was thinking something along the lines of Ajax. Server-side requires the page to reload before displaying results, which isn't ideal. Certainly for storing results, I'll need to have a php connection to the server, but for the poll itself, I'd prefer client-side scripting.

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It requires both types of technologies. As John stated, you'll need server-side scripting not only for storing the results, but also to update/output the results. The actual form elements etc... are going to be HTML with some javascript.

    In any case, here is a tutorial on how to make an Ajax poll.

  5. The Following User Says Thank You to Medyman For This Useful Post:

    ReadyToLearn (05-21-2008)

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
  •