Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Accepting Ajax radio button value Through php

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

Kindly see the code below.

I want to pass Ajax radio button through in php.
<html>
<head>
<script type="text/javascript"> 
function i_am_ajax () {
  var form = document.getElementById("my_form");
  //alert(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")
	   {
	 	alert("kkkk");
	   }
       break;
    }
  }
};


</script>
</head>
<body>
<form id="my_form">
  <table width="880" border="1">
    <tr>
      <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>
    </tr>
    <tr>
      <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>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="2"><input type="submit" name="submit" value="submit"></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>

Open in new window

0
Comment
Question by:ManiBhushan Kumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
10 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 1000 total points
ID: 36477626
This chapter explains it perfectly:
http://www.w3schools.com/php/php_ajax_poll.asp
0
 

Author Comment

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

Expert Comment

by:Ray Paseur
ID: 36581133
You need to accept an answer to close the question.  
http://www.experts-exchange.com/help.jsp#hs=29&hi=407
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ManiBhushan Kumar
ID: 36581404
solved myself.
0
 

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.
0
 
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.  
0
 
LVL 111

Expert Comment

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

597 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