🔒 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
  • 543
    Views
  • 2
    Participants
Last reply from:
Impostor Syndrome

Trending Topics

Online now

Members online
1,111
Guests online
771
Total visitors
1,882

Forum statistics

Threads
2,279,791
Posts
28,993,210
Members
1,226,082
Latest member
diarmdev
Back
Top