So if your php page (called "submitVote.php") takes form vars
(integer) "couponID" and (bit) "vote" and it returns the new
percentage (eg "15%"), and the percentage value lives in a div called
"votePercentage", and you have two buttons called 'voteYes' and
'voteNo':

$('document').ready(function(){
    $('#voteYes').click(function(){
        $('#votePercentage').load("submitVote.php", { couponID: 1,
vote: 1})
    });
    $('#voteNo').click(function(){
        $('#votePercentage').load("submitVote.php", { couponID: 1,
vote: 0})
    });
});

On Mar 5, 7:41 am, crazyryan <[EMAIL PROTECTED]> wrote:
> Hey
>
> Could anyone guide me in the right direction on this:
>
> I want something like:http://www.retailmenot.com/view/amazon.com
>
> The part, 'Did this coupon work for you'
>
> I want that, so when yes or no is clicked, the new percentage is
> brought back.
>
> Someone said I need to do:
> Onclick on worked button, send url to php script via ajax that adds +1
> to the database and then use mysql and stuff on the php script to
> return the value of percentage.
>
> However, I'm kinda new to this stuff so .. Can anyone do the
> javascript bit and I'll do the PHP page?
>
> Thanks, help much appreicated.

Reply via email to