hey! first i found the error in {id: txt} now its { id: txt }
the script is like this everthing else was just to understand how it works sorry for confusion.
my question is like this ID:5
Textarea: "Innput your ID"
pressing the source button and insert
Code:
<input type="hidden" id="check_01" value=""/>
<script>
$(document).ready(function() {
var x = 0;
$("#check_01").val(x);
$("#question5").keyup(function() {
var txt = $("#question5").val();
$.post("id.php", { id: txt }, function(result) {
$("#check_01").val(result);
});
});
$("form#limesurvey").submit(function() {
if( $("#check_01").val() == 0 || $("#check_01").val() == "" ) {
alert("void");
return false;
} else {
alert("true");
return true;
}
});
});
</script>
i hope to accomplish this:
1: force a input of existing ID (id.php checks true false and send it back than i could display true/false)
2: input in question5 has to be stored in database of survey
3: submit button of form#limesurvey returns true if id.php returns true and my idea was to do this by checking a hidden input (id=check_01)
im totally inexperienced and this is my first try and me best idea to do it.