0
How to make a onclick fumction
in php how to make onclick function that's calls a function when click on button
9 ответов
+ 6
php has no way of detecting clicks,its a backend not a front-end language.All of the results are processed before you see it so theres no way of detecting clicks after it has been run.use js
+ 3
You can detect the click inside a form
<form action=”” method=”post”>
<input type=”submit” name=”submit”>
</form>
if(isset($_POST[”submit”])) {
/* Clicked */
}
submit button returns 1 or True if clicked. False otherwise.
+ 1
It's not possible to detect click in php, you do add a js script for detection because php isn't a language client!
You add the js Script to the end of your code, and you call the action in your HTML script.
Look this :
https://developer.mozilla.org/fr/docs/Web/API/EventTarget/addEventListener
0
awsm its working
- 1
how to use in php
- 1
u re rgtt
- 1
plss tell how to use function in php