Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8181785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:38:29+00:00 2026-06-07T00:38:29+00:00

In below code when I click ‘Vote’ a vote results screen is displayed but

  • 0

In below code when I click ‘Vote’ a vote results screen is displayed but when I click ‘Return to poll’ the poll is redisplayed but the button ‘Show Options’ is no longer visible. Is there a way to prevent this button from being hidden when a ‘Return to poll’ is clicked.

Here is the fiddle : http://jsfiddle.net/E2gku/2/

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/5968383.js"></script>
<noscript><a href="http://polldaddy.com/poll/5968383/">This is a test question ?</a></noscript>

<style>
.pds-pd-link {
display: none !important;
}
.pds-box {
    width: 200px !important;
}
.pds-input-label{
    width: auto! important;
}
.PDS_Poll{
    margin-bottom:15px;
}


</style>
<script type="text/javascript">



$(document).ready(function() {

    $('.pds-question').append('<input type="button" class="showanswer" value="Show Options"/>');

        $('.pds-vote').css('display' , 'none');
        $('.pds-answer').css('display' , 'none');
        $('.pds-vote-button').css('display' , 'none');
        $('.pds-view-results').css('display' , 'none'); 

    $('.showanswer').on('click', function () {

            $('.pds-vote').show();
             $('.pds-answer').show();
             $('.pds-vote-button').show();
             $('.pds-view-results').show();

        $('.showanswer').hide();
        $('.pds-question').append('<input type="button" class="hideanswer" value="Hide Options"/>');

        $('.hideanswer').on('click', function () {
                $('.pds-vote').hide();
                 $('.pds-answer').hide();
                 $('.pds-vote-button').hide();
                 $('.pds-view-results').hide();
                $('.showanswer').show();
                 $('.hideanswer').hide();
        });

});

});
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:38:30+00:00Added an answer on June 7, 2026 at 12:38 am

    You can use event delegation to re-append the button when the user clicks to go back to the question:

    $('body').on('click', '.pds-return-poll', function() {
        setTimeout(function(){
            $('.pds-question').append('<input type="button" class="showhideanswer" value="Hide Options"/>');
        }, 10);
    });
    

    I’ve also dried up your code, just a little:

    $(document).ready(function() {
        $('.pds-answer, .pds-vote').css('display' , 'none');
        $('.pds-question').append('<input type="button" class="showhideanswer" value="Show Options"/>');
    
        $('body').on('click', '.pds-return-poll', function() {
            setTimeout(function(){
                $('.pds-question').append('<input type="button" class="showhideanswer" value="Hide Options"/>');
            }, 10);
        }).on('click', '.showhideanswer', function() {
            $('.pds-answer, .pds-vote').toggle();
            if (this.value == 'Show Options')
                $(this).val('Hide Options');
            else
                $(this).val('Show Options');
        });
    });
    

    JSFiddle.

    The timeout is because your default function takes precedence, so interpret this timeout as a deferred object.

    And obviously, as the button is being added dynamically, it will also require event delegation as in my code above (either that or re-binding the event handlers, your choice).

    ​edit: Fixed a bug in Firefox.

    edit2: Dried it up a little more. Selectors are only being used once now so I discarded the selector caching, as the $(document).ready‘s selector can’t be re-used inside the showhideanswer‘s click handler because, for some reason, your plugin’s developer decided to create new elements when you go to the results page and back to the vote page instead of re-using the same elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using VB.NET and below code on button click event. Protected Sub ibtnSendInvites_Click(ByVal
I am using the code below to show/hide a navigation menu on click of
I am testing this simple code below and it works... $(document).ready( function() { $('.show-modal').click(
Why below code does not work: $('button[name=publish]', 'button[name=cancel]').live('click', function(){ alert('ddddd'); }); The html is
Below code works fine in Firefox, but not in IE8. It triggers mouse click
I am using below code to display chinese text on click of a button
I using below code to insert new sms in inbox, but when i click
In the below code,On click Details link the div should show up in an
I'm a beginner in WPF, I put below code in a button click handler,
Below code makes form to be submitted without html5 validation... $j(document).on(click, #client_entry_add, function(event){ ajax_submit();});

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.