I browsed through the other questions on this issue but couldn\'t find a satisfactory answer. I have a quiz website where the user selects an option from four options and then c
Common practice these days would be to use AJAX but this doesn't answer the question, nor would any Javascript solution without any assistance from the back-end. Say you have a form, for example:
When submitting to your PHP file for processing you will be accessing your form data either via $_GET or $_POST and doing whatever you need to do with it. At this point you will be able to deduce whether or not the form has been submitted or is successful - based on this you can simply flag either input or button elements with the disabled attribute, here's a basic example:
This would then output your new form with the button disabled based on your conditions. I should also note that depending on your doctype you may need to give the attribute a value for it to be considered valid markup, but generally speaking:
Some related StackOverflow reading:
What is a doctype?
What does ?: mean? (ternary operator)
PHP: How can I submit a form via AJAX (jQuery version)