I have two pages in php and I need that the value of radioButton selection pass to another page, but it not work.
The jquery code of the page that send the data is:
$(document).ready(function(){
$("#continue").click(function(){
var val = $("input[@name='opt']:checked").val();
$.ajax({
type: 'GET',
url:'editor.php',
data:'radio=' + val,
dataTyoe:'html',
succes: alert(val)
});
});
});
The html code into the php page is:
<input type="radio" id="opt" name="opt" value="opt1" checked="checked">Opt 1<br/>
<input type="radio" id="opt" name="opt" value="opt2"/>opt2<br />
<input type="radio" id="opt" name="opt" value="opt3"/>opt3<br />
<a href="editor.php" id="continue">Guardar continuar</a><br/>
And the code of the page that recive data is the follow.
<?php
$valor = $_REQUEST['radio'];
echo $valor
?>
Thanks
There were some spelling mistakes and need some correction. Try the following code;