Recommend this page to a friend! |
All requests | > | Recommendation for a PHP class to how... | > | Request new recommendation | > | Featured requests | > | No recommendations |
by Sufiyan Syed - 8 months ago (2024-02-24)
+1 | I have an HTML page with some text fields. When the user enters the text fields, it should call either a function or class of PHP. I appreciate your support. |
2. by Cedric Maenetja - 7 months ago (2024-03-18) Reply
There are two ways you can call PHP,
1) onchange element function make an api call <script> $(document).ready(function(){ $("#elementid").change(function(){
// make an api call
$.ajax({
type: "POST",
url: url,
data: data,
success: success,
dataType: dataType
});
}); }); </script>
2) Call the function explicitly in onchange element function <?php
function alertDialog(){
echo "alert('PHP function called.');";
}
?> some html code... <script> $(document).ready(function(){ $("#fname").change(function(){
// call PHP function explicitly
<?php alertDialog(); ?>
}); }); </script>
1. by The Algoslingers - 8 months ago (2024-02-25) Reply
Are you talking about as soon as the user enter some text/input, the data is sent to a backend and then return a resulting indicating the input is correct or wrong or this and that or returns data according what the user typed?
0 | by Manuel Lemos 24325 - 7 months ago (2024-03-20) Comment Hello Sufyiian, The JAXON package does what you need. It can generate JavaScript to send requests to PHP on the server side, so you can implement responses with the information that your forms need on the browser side to process those responses with JavaScript code. Can you test this package and let us know if it works for you or if you need something better? |
Recommend package | |
|