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 7994379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:06:57+00:00 2026-06-04T14:06:57+00:00

I have this form: <FORM id=frmVote action=../vote_dir/proccess.php method=post> <table id=tblMain align=center> <tr> <td class=header></td>

  • 0

I have this form:

<FORM id="frmVote" action="../vote_dir/proccess.php" method="post">
     <table id="tblMain" align="center">
        <tr>
        <td class="header"></td>
        </tr>
    <tr>
        <td>
             <?php
            include "../vote_dir/loadpoll.php";
             ?>
        </td>
    </tr>
    <tr>
        <td>
             <input id="votefor" name="votefor" type="hidden"/>
        </td>
    </tr>
    <tr>
        <td class="button">
             <INPUT class="btnVote" onclick="return confirmSubmit()" type="submit" value="vote"/>
        </td>
    </tr>
    <tr>
        <td class="footer"></td>
        </tr>
     </table>
</FORM>

and this is part of the proccess.php:

<?php
  $votefor = $_POST["votefor"];

  //Get the IP of the user
  $domain = $_SERVER["REMOTE_ADDR"];
  $today = date("m/d/Y");

  echo "<table id=\"tblResults\" align=\"center\">";

  //MORE CODE

// Generate the results table
  $doc = new DOMDocument();
  $doc->load("../vote_dir/xml/results.xml");
  $pollitems = $doc->getElementsByTagName("pollitem");
  foreach( $pollitems as $pollitem )
  {
    $entries = $pollitem->getElementsByTagName("entryname");
    $entry = $entries->item(0)->nodeValue;
    $votes = $pollitem->getElementsByTagName("votes");
    $vote = $votes->item(0)->nodeValue;
    $tempWidth = $vote / $maxvotes;
    $tempWidth = 300 * $tempWidth;
    $votepct = round(($vote / $maxvotes) * 100);
    echo "<tr><td width=\"45%\" class=\"polls\">$entry</td>";
    echo "<td width=\"35%\" class=\"resultbar\"><div class=\"bar\" style=\"background-color: ";
        getRandomColor();
        echo "; width: $tempWidth px;\">$votepct%</div></td><td class=\"each_vote\" width=\"20%\">($vote votes)</td></tr>";
  }
  echo "<tr><td width=\"45%\" class=\"total\" colspan=\"3\">Σύνολο ψήφων: $maxvotes</td>";
  echo "</table>";
?>

Like it is now it works fine. but I am trying to make it load my results in a specific div instead of opening the results like

I am trying to use this jquery (that I used in other things), it is working partialy since it opens the results in the div but it seems it doesn’t sent the form into the proccess.php since I can see the result page without any change or message e.g “You have already voted”.

  .delegate('.btnVote', 'click', function(){
     var keyValues = {
      votefor : $(this).parent().find('input[name="votefor"]').val()
     };
     $.post('../vote_dir/proccess.php', keyValues, function(rsp){
      $('#voting').load('../vote_dir/results.php');
     });
     return false;
  })

this is my loadpoll.php

<?php 
  // Load the results xml file
  $doc = new DOMDocument();
  $doc->load("../vote_dir/xml/results.xml");
  $root = $doc->getElementsByTagName("results")->item(0);
  $question = $root->getAttribute("question");
  echo "<table id=\"tblPoll\" align=\"center\"><tr><td class=\"question\">$question</td></tr>";
  echo "<tr><td class=\"pollitem\">";
  $pollitems = $doc->getElementsByTagName("pollitem");
  $id = 1;
  // Loop through each item, and create a radio button for each item
  foreach( $pollitems as $pollitem )
  {
    $entries = $pollitem->getElementsByTagName("entryname");
    $entry = $entries->item(0)->nodeValue;
    $votes = $pollitem->getElementsByTagName("votes");
    $vote = $votes->item(0)->nodeValue;
    if ($id==1)
        echo "<input id=\"entry$id\" class=\"radiobutton\" onclick=\"setVote('$entry')\" type=\"radio\" name=\"poll\" value=\"$entry\">$entry<br>";
    else
        echo "<input id=\"entry$id\" onclick=\"setVote('$entry')\" type=\"radio\" name=\"poll\" value=\"$entry\">$entry<br>";
    $id = $id + 1;
  }
  echo "</td></tr>";
  echo "</table>";
?>
  • 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-04T14:06:58+00:00Added an answer on June 4, 2026 at 2:06 pm
      $('.btnVote').live('click', function () {
                    $.post('../vote_dir/savevote.php', { votefor: $.trim($(this).parents('form').find('input[name="votefor"]').val()) }, function (data) {
                        $('#voting').html(data);
    
                        //Or
    
                        //$('#voting').load('../vote_dir/results.php');
                    });
    
                    return false;
                });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form: <form method=post action=mypage.php orderform= name= id=orderform> <a id=add>+</a> <table width=533
I have this form: <form action=contact.php method=post id=contactform> <ol> <li> <label for=name>First Name *
I have this form: <form action=after.php method=post id=divulgacao> <div style=float: left;width: 195px; margin-right: 10px;>
I have this form: <div class=row border-tb> <form id=test-form action=/test/insert method=post class=form-inline offset4 span16>
I have this form: <form name=commentform id=commentform action=comment.php method=post enctype=multipart/form-data> Your Name: <textarea maxlength=60
I have this form declaration: <form method=post action=/web_services/buscar_vuelos?method=get> <div id=addSegment_wrapper> <button class=ui-button ui-widget ui-state-default
i have this form: <form id=myform name=myform action=test.php method=post> <input type=text name=shout-in id=proShoutIn maxlength=80
I have this form: <form action=javascript:; class=iceFrm enctype=application/x-www-form-urlencoded id=frmMainMenu method=post onsubmit=return false;> ..... </form>
I have this form : <form action=index.php?explore=browse method=post> <input type=hidden name=artist value=<?=$artist?> /> <input
I have this form: $form = array( '<form name=backup-form class=backup-form method=post action=#>', '<fieldset class=backup-fields>',

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.