Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Validate text input from database

Validate text input from database 4 months 2 weeks ago #118320

  • noob
  • noob's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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
<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.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.481 seconds