> Hi,
\\ snip snip
> print "<INPUT TYPE=\"hidden\" onclick="IDONT KNOW HJOW TO
> PUT JAVAScript here"NAME=\"PHPSESSID\" VALUE=\"$ID\">";
>
\\ snip snip
>
> to let you more understand.. how can i insert to call the JavaScript
> Function like onclick, onblur, onDoubleClick, etc..
>
> i really dont know the format how to code it the php and Javascript coz
> they are both separated files.
>
> all idea will considerable help...
You would embed your javascript in PHP the same way that you would HTML
code, escaping any special characters, like quotations, dollar signs,
etc.
The only point where you may run into problems is when it comes to putting
in the </script> tag, as PHP could treat this just as though it were
reading a ?> tag. But I am pretty sure that you will only run into that
problem if you use <script language="php"> to open PHP parsing. If you
use
the standard <?, or <?php this probably won't be a problem. In any case
it is easily solvable, just escape php parsing with a ?> before
encountering the </script> tag.
Of course JavaScript code isn't going to execute till client side, so PHP
is going to treat it like plain old text while on server side.
I hope that answers your question?
: )
Rich
Hi again...
im just having problem how to parse javascript with php code..
like somewhere in my input textbox onchange/onclick do my eventHandler
how can i encapsulate JavaScript into my PHP code from my previous
example?