Accepting Ajax radio button value Through php

Posted on 2011-09-03
Medium Priority
Last Modified: 2013-12-13
Dear Friend,

Kindly see the code below.

I want to pass Ajax radio button through in php.
<script type="text/javascript"> 
function i_am_ajax () {
  var form = document.getElementById("my_form");
  for ( var i = 0; i < form.length; i++ ) {
    if ( form[i].checked ){
		var mode = form[i].value;
       alert( form[i].value );
	   if (mode=="aaaa")

<form id="my_form">
  <table width="880" border="1">
      <td width="218"><input type="radio" id="one" name="one" value="aaaa" onClick="i_am_ajax()" />aaaa</td>
      <td width="213">&nbsp;</td>
      <td width="163"><input type="radio" id="one" name="one" value="bbbb" onClick="i_am_ajax()" />bbbb</td>
      <td width="258">&nbsp;</td>
      <td><input type="radio" name="aaaa" value="cccc"  />cccc</td>
      <td><input type="radio" name="aaaa" value="dddd"  />dddd</td>
      <td><input type="radio" name="bbbb" value="eeee"  />eeee</td>
      <td><input type="radio" name="bbbb" value="ffff" />ffff</td>
      <td colspan="2"><input type="submit" name="submit" value="submit"></td>

Open in new window

Question by:ManiBhushan Kumar
  • 4
  • 3
LVL 111

Accepted Solution

Ray Paseur earned 1000 total points
ID: 36477626
This chapter explains it perfectly:

Author Comment

by:ManiBhushan Kumar
ID: 36571745
close this .
LVL 111

Expert Comment

by:Ray Paseur
ID: 36581133
You need to accept an answer to close the question.  
Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.


Author Comment

by:ManiBhushan Kumar
ID: 36581404
solved myself.

Author Comment

by:ManiBhushan Kumar
ID: 36581521
I've requested that this question be closed as follows:

Accepted answer: 0 points for mani09's comment http:/Q_27289950.html#36581404

for the following reason:

i did not get proper answer.
LVL 111

Expert Comment

by:Ray Paseur
ID: 36581522
I object to closing this question without a solution.  The author wrote on September 3, I want to pass Ajax radio button through in php. and the article from the W3 Schools, posted on September 3, shows exactly how this is done.  
LVL 111

Expert Comment

by:Ray Paseur
ID: 36593562
Recommend accept http:#a36477626

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question