What's new

Closed Dynamically perform

Status
Not open for further replies.

Netflix

Forum Veteran
Joined
Jul 12, 2016
Posts
1,825
Reaction
816
Points
883
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!"

}



?>
 
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))
})
 
Status
Not open for further replies.

Similar threads

Back
Top