I have this in my code and it doesnt work, please help me guys, I want to try passing the value when i pull from the dropdown, it process the data by onChange and showing the value in the tag
<label for="headmark" class="lbl-ui select">
<select id="headmark" name="headmark" onChange="getVal(this)">
<?php while (oci_fetch($headmark_parse)){?>
<option value="<?php echo $head_mark ?>" id="headmark">
<?php echo "$head_mark"; ?></option>
<?php } ?>
</select>
</label>
<script type="text/javascript">
function getVal(val){
$.ajax( {
type: 'POST',
url: update_fab_progress.php,
data: "&val=" + val,
success: function(data) {
alert("data");
}
} );
}
</script>
<?php
echo $_POST['val'];
?>
Use chrome developer tool to help you debug. I think your parameter 'val' in javascript is a little strange. May be, you send a request with empty parameter.