All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.

Author Topic: How to use image for poll "vote" button?  (Read 5524 times)

0 Members and 1 Guest are viewing this topic.

Offline Holstein Grove

  • Newbie
  • *
  • Posts: 8
    • View Profile
How to use image for poll "vote" button?
« on: 16 March 2007, 20:21 »
Good afternoon!

I want to use an image for the "vote" button in my polls so that it matches the rest of the form buttons on my blog.

In the voting form footer box in WP admin, I modified the code so that it looks like...

Code: [Select]
<p style="text-align: left;"><input type="image" src="http://wisgrove.com/images/grove/search.jpg" style="border:none; background:none; padding:2px;" name="vote" class="Buttons" onclick="poll_vote(%POLL_ID%);" /></p>
<p style="text-align: left;"><a href="#ViewPollResults" onclick="poll_result(%POLL_ID%); return false;" title="View Results Of This Poll">View Results</a></p>
</div>

It displays the button image, but when you click on it, the poll results are not displayed and the vote is not counted. How can I redo my code so that I can use the button image and so the poll works?

You can see the problem exactly as it is here... www.wisgrove.com

Thank you in advance!

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: How to use image for poll "vote" button?
« Reply #1 on: 17 March 2007, 08:03 »
weird, can u have that code in so that I can see it?

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Holstein Grove

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #2 on: 17 March 2007, 12:46 »
Okay... I put the code back in. I went back to the default code so that visitors to my site could use the poll. The code with the image button is back in there now, so you can have a look at it. Thanks for your patience!

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #3 on: 17 March 2007, 16:30 »
OK
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: How to use image for poll "vote" button?
« Reply #4 on: 18 March 2007, 04:18 »
still the same, the normal button

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #5 on: 18 March 2007, 16:13 »
Hmm..
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline Holstein Grove

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #6 on: 19 March 2007, 16:19 »
The image button is there. Anyway, it seems to be recording votes now, but instead of fading in place into the poll results the way it should, clicking the vote button takes the user directly to a plain white page where the poll results are displayed in plain text form. (?)

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: How to use image for poll "vote" button?
« Reply #7 on: 19 March 2007, 17:05 »
hmmm instead of doing it this way, what about u try to assign css to the button and use background-image: url();

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Holstein Grove

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #8 on: 19 March 2007, 17:30 »
Okay... In my theme's style sheet, I put

Code: [Select]
#vote {
 background-image: url(http://wisgrove.com/images/grove/vote.jpg);
 }

and them in the box for Voting Form Footer under Poll Options in WP Admin, I have

Code: [Select]
<p style="text-align: left;"><input type="button" name="vote" value="" class="#vote" onclick="poll_vote(%POLL_ID%);" /></p>
<p style="text-align: left;"><a href="#ViewPollResults" onclick="poll_result(%POLL_ID%); return false;" title="View Results Of This Poll">View Results</a></p>
</div>

Unfortunately, the button is not showing at all now. Please forgive my poor CSS skills, I will admit to not being very good with CSS.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: How to use image for poll "vote" button?
« Reply #9 on: 20 March 2007, 08:17 »
you may want to google for it because my css skills are also limited. lol

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Holstein Grove

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #10 on: 20 March 2007, 10:39 »
I'll probably just have to stick with the default form button after all. Thanks anyway, though!

Offline Holstein Grove

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #11 on: 20 March 2007, 12:47 »
Okay... I finally figured out how to make it work. Works in both Firefox and IE. In polls-css.css, change

Code: [Select]
.wp-polls .Buttons {
border:1px solid #8e8461;
background-color: #dcd9be;
}

so that it looks like

Code: [Select]
.wp-polls .Buttons {
background-image: url(your image url);
width: 52px;
height: 23px;
padding: none;
border: none;
        cursor: pointer;
}

Obviously the color codes, image url and the like would vary by person.

Then in the poll options section of WP Admin, in the voting form footer box, change

Code: [Select]
value="Vote"
to

Code: [Select]
value=""

This way, you will not have two sets of text overlapping each other if the button image already contains the caption. And that's it!

My problem all along was that I was trying to do the right thing in all the wrong places. My wordpress theme's stylesheet did not have to be modified at all, and I only needed to make one very small adjustment in poll options. All the action is in the poll's own CSS style sheet.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: How to use image for poll "vote" button?
« Reply #12 on: 20 March 2007, 14:25 »
glad it works for u, and thanks for sharing

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,296
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #13 on: 20 March 2007, 15:44 »
Stole my line. ;D LOL
   
    Glad it works...
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline jeneni

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: How to use image for poll "vote" button?
« Reply #14 on: 20 June 2009, 17:10 »
Thanks! The css background fix definitely worked for me as well.