cant get the value from the form. Due to Firebug the form is submitted tho and when I delete the js it works so it has somethin to do with it. I guess i somehow have to fetch the values ($_POST) with js in the script but im not familiar with js so i havent being able to solve it.
[CODE]$ok= $_POST[‘ok’]; //this doesnt work
if($ok== “ok” ){
echo “works”;
}
<script type=”text/javascript”>
$(document).ready(function() {
var frm = $(‘#form’);
frm.submit(function (ev) {
$.ajax({
type: frm.attr(‘method’),
url: frm.attr(‘action’),
data: frm.serialize(),
});
ev.preventDefault();
});
});
function submitForm2() {
$(‘#form’).submit();
}
</script>
<div onclick=’submitForm2();’></div>
<form action=” method=’post’ id=’form’>
<input type=”hidden” name=’ok’ value=”ok”>
</form>