Link to home
Start Free TrialLog in
Avatar of ManiBhushan Kumar
ManiBhushan KumarFlag for India

asked on

Accepting Ajax radio button value Through php

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

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ManiBhushan Kumar

ASKER

close this .
You need to accept an answer to close the question.  
https://www.experts-exchange.com/help.jsp#hs=29&hi=407
solved myself.
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.
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.  
Recommend accept http:#a36477626