I'm really stuck here, I know it is a basic question but I really need some help.
I have a radio box in html which I have to following code to get show which radio box is selected.
<script>
$( "input" ).on( "click", function() {
alert($( "input:checked" ).val() + "" );
});</script>
This works as expected, what I would like to do now is when the radio box is selected still display the alert but also export the alert contents to a php file, I have tried all sorts of methods and have come up short, any help would be greatly appreciated.
I tried with ajax with the following code, I have no idea where it is going wrong
$( "input" ).on( "click", function() {
$.ajax({ //Process the form using $.ajax()
type : 'POST', //Method type
url : 'process.php', //Your form processing file URL
data : $( "input:checked" ).val() + "Entered";
success : alert($( "input:checked" ).val() + "Entered" );
});
});</script>