Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Disable Element by PHP if-statement
(1 viewing) (1) Guest
All your queries regarding JavaScript will be solved in this forum
  • Page:
  • 1
TOPIC:

Disable Element by PHP if-statement

Disable Element by PHP if-statement 1 year, 6 months ago #319

  • shama
  • OFFLINE
  • Senior Boarder
  • Posts: 63
  • Karma: 0
Hey, as the summary already states, I want to disable an HTML-Element with PHP if an action occurs.

For example I have a simple input button, and if the input button has been clicked 5 times, it is being disabled.

If anyone has an idea, please help.

Re: Disable Element by PHP if-statement 1 year, 2 months ago #542

  • sandhya
  • OFFLINE
  • Senior Boarder
  • Posts: 42
  • Karma: 0
Is the input button going to refresh the page?

If so, we can count the clicks with PHP and then disable the button by adding the "disabled" attribute with PHP before spitting the HTML out. If not, we need to count with JavaScript and PHP has nothing to do with this, and we can disable the button with JavaScript.
  • Page:
  • 1
Time to create page: 1.21 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download