|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
javascript function call inside the php code(echo)
im having problem to put the javacsript function call inside the php code. please give me some ideas on how to do it. this is my sample code:
echo('<p><input type="text" name="name" onClick="myfunction();"></p>'); javacriptcode <!-- function myfunction(){ //my code } --> your help is appreciated. thankz.. |
|
#2
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Client Side Things' by notepad.
Reason: php looks fine |
|
#3
|
|||
|
|||
|
RE: javascript function call inside the php code(echo)
what's to click on a text field? ..perhaps you mean onFocus?
|
|
#4
|
||||
|
||||
|
RE: javascript function call inside the php code(echo)
Instead of this:
echo('<p><input type="text" name="name" onClick="myfunction();"></p>'); escape the quotes by doing this: echo "<p><input type="text" name="name" onClick="myfunction();"></p>"; |
|
#5
|
|||
|
|||
|
RE: javascript function call inside the php code(echo)
how would that make any difference?
|
|
#6
|
|||
|
|||
|
RE: javascript function call inside the php code(echo)
Try defining the JavaScript function before you call it. Define the JavaScript in the head, then call it later. Also, try making it
onClick="javascript:myfuntion()" or whatever it was called |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > javascript function call inside the php code(echo) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|