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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:20:52+00:00 2026-05-24T05:20:52+00:00

I am completely new to javascript/jquery, and would appreciate any help. I am having

  • 0

I am completely new to javascript/jquery, and would appreciate any help.
I am having trouble with the function $.post because I am using radio in the form. I need to use the value of the chosen radio in a different file, so that I can process what should be outputted, and then I want to output something in place of where the form is.

Here is the form with type radio input:

<div id='poll'>   
<form name='poll_form' id='poll_form'>    
      <INPUT TYPE="radio" name='poll'  value ='poll1'/>Option1<br/>
      <INPUT TYPE="radio" name='poll'  value='poll2' />Option2<br/>
      <INPUT TYPE="radio" name='poll'  value='poll3'/>Option3<br/>
      <INPUT TYPE="radio" name='poll'  value='poll4'/>Option4</br>
      <INPUT TYPE='button'  value='Submit Vote' onClick="vote();" />
</form>
</div>

Here is the javascript/jquery to define the “vote();” function:

<head>
<script type = "text/javascript" src="jquery.js"></script>

<script type = "text/javascript">
  function vote() {
      $.post('file.php',$('input:radio[name=poll]:checked').val(),
        function(output){
          $("#poll").html(output).show();
        });
  };
</script>
</head>

Is $('input:radio[name=poll]:checked').val() the correct thing to use? And if so, how do I retrieve the value of $('input:radio[name=poll]:checked').val() in file.php?

  • 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-05-24T05:20:54+00:00Added an answer on May 24, 2026 at 5:20 am

    To post values you would have to declare a post-variable and assign your value to it, i.e.

    $.post('file.php',{ poll: $('input:radio[name='poll']:checked').val() }, function() {
        $("#poll").html(output).show();
    });
    

    In your PHP file you can access the value via

    $_POST['poll']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am relatively new to Jquery and I was wondering how would one post
I'm completely new to jQuery/javascript and have been beating my head against this simple
Well, I'm completely new to JavaScript. Can you please tell me what type of
I'm completely new to the javascript and ajax world but trying to learn. Right
I'm completely new to Flex and am just having a play with a sample
I'm completely new to JQuery and MVC. I'm working on a pet project that
Folks, I am completely new to jQuery and JqGrid both. Usually I take some
I'm looking for a good 10 minute introduction to Unobtrusive Javascript using JQuery. I'm
I'm new to jQuery Thickbox. I've implemented the following code: HTML: <a class=thickbox href=javascript:void(0);
I'm fairly new to the whole JQuery/javascript world, but I've managed to wack together

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.