Forum Moderators: coopster

Message Too Old, No Replies

how to activate button to open the link?

how to activate button to open the link?

         

shams

3:25 pm on May 17, 2006 (gmt 0)

10+ Year Member



hi,
this php script create a button, on click should open a page , when i run the code shows the button with the label OK but when i click on ok can't open the page:
<?php
echo "values inserted do you want to all other patient:";
echo "<button onCLICK='window.location='formInsertTable.php''>";
echo "OK";
echo "</button>";
?>

any one can help please?

jatar_k

5:30 pm on May 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if you use firefox or mozilla you can type

javascript:

into the location bar then hit enter, this will give you a js debugging window that will help with the error

I am guessing though that the single quotes here
'window.location='formInsertTable.php''

are your problem all that will be in that onclick is

'window.location='

due to the single quote ending the param

mooger35

6:50 pm on May 17, 2006 (gmt 0)

10+ Year Member



This works...

<?php
echo "values inserted do you want to all other patient:";
echo "<input type=\"button\" ";
echo "value=\"OK\" ";
echo "onClick=\"location.href='formInsertTable.php'\">";
?>

or this, using <button>

echo "values inserted do you want to all other patient:";
echo "<button onCLICK=\"window.location='formInsertTable.php'\">";
echo "OK";
echo "</button>";