CodeIgniter Forums
ask about onchange and onclick php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: ask about onchange and onclick php (/thread-52929.html)



ask about onchange and onclick php - El Forum - 07-02-2012

[eluser]C_Line[/eluser]
i have a problem with onchange and onclick
i wan enter a value in textbox and call the function
like this :

========================================================
<input onchange="here()" type=“text"name=“qty”>

<?php
function here()
{
echo “hello”;
}
?>
=========================================================

but, when i entered the value, here() function didn’t call
please help me, and sorry my bad english Big Grin
thx


ask about onchange and onclick php - El Forum - 07-02-2012

[eluser]CroNiX[/eluser]
onchange/onclick are javascript events. You can't execute php like that. Your Hello function would need to be a javascript function, not php.


ask about onchange and onclick php - El Forum - 07-02-2012

[eluser]C_Line[/eluser]
ooh, okay
but i have another problem
after my function called

i can't use php code like below ?
================================================================
<input onchange="here()" type = "text" name="aaa" />

[removed]
function here()
{
<?php
echo "asd"; /// <- this code
?&gt;
}

================================================================





ask about onchange and onclick php - El Forum - 07-03-2012

[eluser]C_Line[/eluser]
SOLVED
thx for replies CroNiX Big Grin