Forum Moderators: coopster

Message Too Old, No Replies

Can't new page to open using button

         

outdoorxtreme1

12:26 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



Here is the code I have. Does anyone see anything wrong with it? It won't go to the url when clicked.

Thanks in advance

echo '<FONT COLOR=FFFFFF SIZE=3>';
echo '<BR>';
echo '<B>Clarion River</B><BR>';
echo '<B>Pennsylvania</B><BR>';
echo '<B>Yakpacking trip</B><BR>';
echo '<BR>';
echo '<b>August<br>';
echo '4th - 6th</b><BR>';
echo '<BR>';
echo '</font>';
echo '<form>';
echo '<input type="button" onClick="parent.location='page.html'">';
echo '</form>';

dreamcatcher

12:36 pm on Jul 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi outdoorxtreme1,

I`m guessing this line is throwing a parse error?

echo '<input type="button" onClick="parent.location='page.html'">';

You need to escape apostrophes:

echo '<input type="button" onClick="parent.location=\'page.html\'">';

dc

outdoorxtreme1

1:38 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



Thanks, that worked. Any idea how to get it to open to a new window instead of the current one?

mooger35

3:27 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



somthing like this?

<INPUT type="button" value="New Window" onClick="window.open('page.html','mywindow','width=600,height=400,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')">

/don't forget to escape the apostrophes