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>
1 Answer
+ 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.