Possible Duplicate:
jQuery.post() in WordPress
I want to get the value of select element and use them in PHP. I used jquery to get them out, but I could not pass it to PHP. This is my code:
<script>
$(document).ready(function(){
$("button").click(function(){
var team = $("select#team option:selected").val();
var ath = $("select#athletes option:selected").val();
var tour = $("select#tour option:selected").val();
var h = $("#hour").val();
$.ajax({
type:"post",
url:"?page_id=26&t="+team+"&a="+ath+"&to="+tour
}
}
)
});
});
</script>
is there anything wrong? I work this in WordPress. I thought that the url may be wrong. Please help me, thanks!
1 Answer