Jump to content

[SOLVED] Javascript in PHP


joeri

Recommended Posts

Hi all,

 

I'm working in PHP and I have some problems with placing javascript in it.

I have the following line in HTML:

 

<INPUT TYPE="text" value="Search for model.." size="16" NAME="model" onFocus="this.value=''" onBlur="if(this.value==''){this.value='Search for model..';}" onKeyPress="onEnter();" >

 

That works well, but now that I want to make the same in PHP, I have this:

 

echo"<INPUT TYPE='text' value='Search for model..' size='16' NAME='model' onFocus='this.value='' onBlur='if(this.value==''){this.value='Search for model..';}' onKeyPress='onEnter();'>";

 

This doesn't work, who can tell me what goes wrong?

 

Thanks in advance,

 

Joeri

Link to comment
https://forums.phpfreaks.com/topic/39318-solved-javascript-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.