2 Replies - 1730 Views - Last Post: 08 June 2010 - 04:08 PM

#1 konk353535   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 170
  • Joined: 04-December 08

onClick in if else

Posted 14 May 2010 - 11:18 PM

hello im trying to run a code that runs in a <input button onclick="setTimeout('countdown()',1000);"> i know thats not correct code btw :)
anyway im trying to run that code if and IF statement is made so i did
if (x == 0){
run the onclick
}


but i dont know how to do that in php sorry if my question is very vague i dont know what to say basicly i want to do setTimeout('countdown()',1000); which is from a java script code in a php if statement i could do it in a html button onclick so how do i do it in php thanks

Is This A Good Question/Topic? 0
  • +

Replies To: onClick in if else

#2 Fratyr   User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 139
  • Joined: 10-April 08

Re: onClick in if else

Posted 16 May 2010 - 03:36 AM

1) Use punctuation !!! And rewrite your question, so at least I could understand it.
2) You can't call PHP from Javascript
3) Learn about (In Google) 'What is Client Side' 'What is Server side' and how to interact with them
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4201
  • View blog
  • Posts: 13,273
  • Joined: 08-June 10

Re: onClick in if else

Posted 08 June 2010 - 04:08 PM

an onclick code only runs, if a click event happens. (although you could modify your click handler to meet additional conditions to complete)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1