JavaScript and client side scripting.
Moderator: General Moderators
helloise
Forum Commoner
Posts: 31 Joined: Tue Sep 21, 2010 4:20 am
Post
by helloise » Thu Jan 13, 2011 6:59 am
Code: Select all
<script type="text/JavaScript">
function refreshPage(s)
{
window.location.reload();
if((s.options[s.selectedIndex].value) = "zed=catcher")
{
alert (s.selectedIndex); [color=#FF0000]//this is showing[/color]
<?PHP
//the next lines aint
echo $form['service_code']->renderLabel();
echo $form['service_code']->renderError();
echo $form['service_code'];
?>
}
}
</script>
please help?
thanks
Last edited by
Benjamin on Fri Jan 14, 2011 1:21 am, edited 1 time in total.
Reason: Added [syntax=javascript] tags.
AbraCadaver
DevNet Master
Posts: 2572 Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:
Post
by AbraCadaver » Thu Jan 13, 2011 10:01 am
Because the PHP is being executed on the server and the resulting JavaScript is then sent to the browser. You would probably need to do something like:
Code: Select all
document.write('<?PHP echo $form['service_code']->renderLabel(); ?>');
document.write('<?PHP echo $form['service_code']->renderError(); ?>');
document.write('<?PHP echo $form['service_code']; ?>');
mysql_function(): WARNING : This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
helloise
Forum Commoner
Posts: 31 Joined: Tue Sep 21, 2010 4:20 am
Post
by helloise » Fri Jan 14, 2011 12:32 am
thank you it works but i displays it in a new page ! i want it to display on current page please?
thanks