🔒 Closed Dynamically perform

Status
Not open for further replies.

Netflix

Forum Veteran
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.

About this Thread

  • 1
    Replies
  • 568
    Views
  • 2
    Participants
Last reply from:
Impostor Syndrome

Trending Topics

Online now

Members online
1,314
Guests online
3,538
Total visitors
4,852

Forum statistics

Threads
2,305,826
Posts
29,168,073
Members
1,195,464
Latest member
tibolok
Back
Top