N Netflix Forum Veteran Joined Jul 12, 2016 Posts 1,825 Reaction 816 Points 883 Dec 6, 2018 #1 paano ko po magagawa to, each time mag iinput ang user sa textbox , mag checheck automatically through php script.. and without refreshing the page po sana This is the input. Code: <label>Precinct</label> <input type="text" name="precinct" id="precint" class="form-control" required> gusto ko sana mag perform tong script na to PHP: <?php include('../Config/config.php'); $query="SELECT * from voters WHERE precinct="$_POST['precinct']"; $passed=mysqli_query($mysqli,$query); if(mysqli_num_rows($passed)>200) { echo "precinct full!" } ?>
paano ko po magagawa to, each time mag iinput ang user sa textbox , mag checheck automatically through php script.. and without refreshing the page po sana This is the input. Code: <label>Precinct</label> <input type="text" name="precinct" id="precint" class="form-control" required> gusto ko sana mag perform tong script na to PHP: <?php include('../Config/config.php'); $query="SELECT * from voters WHERE precinct="$_POST['precinct']"; $passed=mysqli_query($mysqli,$query); if(mysqli_num_rows($passed)>200) { echo "precinct full!" } ?>
I Impostor Syndrome Honorary Poster Dec 7, 2018 #2 Async validation tawag dun. Gawin mo yung ajax call sa keypress event ng input field. something like this... [ Code: const fetchPrecinct = () => { return $.ajax({...params}) } $('.precinct-field').keypress(e => { $.debounce(250, fetchPrecinct(e)) })
Async validation tawag dun. Gawin mo yung ajax call sa keypress event ng input field. something like this... [ Code: const fetchPrecinct = () => { return $.ajax({...params}) } $('.precinct-field').keypress(e => { $.debounce(250, fetchPrecinct(e)) })