I have this script in ajax and is used to pass the value chosen by the user in the combo box to php. This also handles the submit button.
AJAX:
<script>
function loadXMLDoc(usertype) {
var value = $('#usertype').val();
var page='checksignup.php?usertype='+usertype;
document.location.href=page;
}
$( "#register_Chairperson" ).submit(function( event ) {
var usertype = $('#usertype').val();
alert(usertype);
loadXMLDoc(usertype);
event.preventDefault();
});
</script>
And I'm using this php code to get the value pass by ajax. But my problem is that nothing happens. My address became only like this: http://localhost/civil-engineering-dept/checksignup.php?usertype=1
. It did not continue in checking for the form for signing up. What do you think is the problem?
PHP:
$user = $_GET["usertype"];