0

Incorporate enable.and disable submit button with javascript in a php file

How would I enable and disable the submit button using Javascript based on code you did? This code below works but don't know how to incorporate it in a php file? <!DOCTYPE html> <html> <body> <button id="myBtn">My Button</button> <p>Click the button below to disable the button above.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("myBtn").disabled = true; } </script> </body> </html>

29th Nov 2019, 12:59 PM
Making A Change
Making A Change - avatar
1 Antwort
+ 4
There is no separate way of doing it, Since you can put HTML and JS both in PHP file, Simply paste it in your php file.
29th Nov 2019, 1:10 PM
Raj Chhatrala
Raj Chhatrala - avatar