Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Multiple POLLS on 1 page?
Old 07-31-2008, 11:09 PM Multiple POLLS on 1 page?
Extreme Talker

Posts: 176
Name: Aaric
Trades: 0
I've seen poll scripts and downloaded/used them. I have followed tutorials on creating a poll and used that...

I run a website that is for a martial arts event. For each event we have a Fight Card page (page showing who is fighting who). I would like for each match to have buttons under it where the viewer can vote for one of the 2 fighters in that match. Basically click who they think would win each fight. Ultimately I'd like it so you click the fighters picture and then under the info for that particular fight info pops up saying 80% Fighter A / 20% Figher B
(basically the % of who voted for who).

I haven't been able to make a poll where you click on the picture to vote and I haven't been able to make a poll where you can vote for each fight. Each poll I have made only really lets you have 1 poll per page otherwise the voting gets all screwed up...

Can anyone help or point me in the right direction?
aaricwon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-01-2008, 01:25 PM Re: Multiple POLLS on 1 page?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
I'm not sure if I fully understand, but I think you should use AJAX to submit a vote to some php script.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 08-03-2008, 07:22 PM Re: Multiple POLLS on 1 page?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
The image thing is a bit tricky to make compatible. When I built something like that before, I started by just displaying the page with the images and set the image as the label for a radio button (so, clicking on it is the same as clicking the radio button). Then, with javascript, I hid all the radio buttons. That made it work for everyone.

For multiple polls, it really just depends on how you structure the name of the radio buttons. If it's of the form vote[battle_id]=suggested_winner, then you'll have an array of votes you can parse. This has the added advantage of allowing the user to vote for all battles at once. Just be sure to not set radio buttons as initially selected or incorrect votes will be counted.

That's the overall view. For more specific guidance, give it a shot and post your code w/ questions here.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 08-04-2008, 07:26 PM Re: Multiple POLLS on 1 page?
Extreme Talker

Posts: 176
Name: Aaric
Trades: 0
radio buttons would even work. that would be perfect. i just can't find a way to do it.

that would be just as good as clicking the image.
aaricwon is offline
Reply With Quote
View Public Profile
 
Old 08-04-2008, 07:36 PM Re: Multiple POLLS on 1 page?
Extreme Talker

Posts: 176
Name: Aaric
Trades: 0
There would be several of these on one page (between 10 and 20)

at first it would look like this:


the viewer would click on who they think would win and they would then see this:



It would be like this for each fight. I just have no clue how to set it up!
aaricwon is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multiple POLLS on 1 page?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21199 seconds with 12 queries