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

  • SEARCH
  • Home
  • 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 7772817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:58:01+00:00 2026-06-01T16:58:01+00:00

i have a jsfiddle here . What it does is that when the user

  • 0

i have a jsfiddle here. What it does is that when the user clicks on the “Add Question” button, it adds a radio buttons in each row. But what I want to do is use $_POST to post selected radio buttons in each row into the the insertQuestions.php page (action the form takes use to).

So what I want to know is how do I write the $_POST statement to be able to paste checked radio buttons?

UPDATE:

Is this code below correct in terms of finding the ReplyId for the selected radio by using z case statement then a query:

$i = 0;
$c = count($_POST['reply']);

$insertquestion = array();

for($i = 0;  $i < $c; $i++ ){

    switch ($_POST['reply'][$i]){

    case "Single": 
    $selected_option = "Single";
    break;

    case "Multiple": 
    $selected_option = "Multiple";
    break;

    default:
    $selected_option = "";
    break;

    }      


    $replyquery = "SELECT ReplyId FROM Reply WHERE (ReplyType = '". mysql_real_escape_string($_POST['reply'])."')";
    $replyrs = mysql_query($replyquery);
    $replyrecord = mysql_fetch_array($replyrs);
    $replyid = $replyrecord['ReplyId']; 
  • 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-01T16:58:02+00:00Added an answer on June 1, 2026 at 4:58 pm

    All you need to do is when you run your AJAX script. On the process page you would use something like

    <?PHP
    $reply1 = $_POST['reply1'];
    $reply2 = $_POST['reply2'];
    

    however you will want to change the name of the input fields to name="reply[]" which will make the posted data an array

    UPDATE:
    The previous is only valid for checkboxes in this case (which there are none) With checkboxes of the same name, is checkbox 1 is checked and then checkbox 2 is checked, you will only get the value of checkbox 2 on the post.

    Since reply is the name with a number after for duplicated questions, you can always get all posted variables by just using $_POST. Doing this will give you an array of ALL posted data

    If you want to go through each reply since it is dynamic just do a foreach statement

    foreach($_POST as $k=>$v) {
        //Run script to process each posted reply 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid of buttons where if the user clicks on a button,
I have a jsfiddle here . What happens is that if you select a
I have a Jsfiddle application here . If you type in a question in
I have a CSS mouseover slider fully functional here http://jsfiddle.net/gU4sw/13/ . When I add
Ok, if you go here: http://jsfiddle.net/RarFB/2/ You will see the work that I have
I have a grid of buttons in my code where the user clicks on
I have a fiddle here http://jsfiddle.net/WULsZ/1/ I load jQuery first and the code is
I have a pure CSS mouseover slider fully functional here http://jsfiddle.net/gU4sw/13/ . When I
I have created a jsfiddle of my problem. Here is a link to the
I have a flot bar chart here as a jsFiddle . Now i need

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.