I have two radio buttons for which I want to get the checked value and then pass to a url query string:
here is the html
<h3>Please select an audience</h3>
<p><input class="age" type="radio" name="ageLimit" value="allAge"/> All ages </p>
<p><input class="age" type="radio" name="ageLimit" value="mature"/> Mature</p>
This is the js:
when I use this, the database pulls [object, Object]
url : 'upload.php?aud='+$('input[name="ageLimit"]:checked', '#myForm').val($('input:radio[name="ageLimit"]:checked', '#myForm')),
when I use this it only pulls the first variable
url : 'upload.php?aud='+$('input[name="ageLimit"]:checked', '#myForm').val(),
How do I get the checked variable to pass into the query string? I have looked at several similar questions on SO, but nothing treats a query string