Forum Moderators: coopster

Message Too Old, No Replies

javascript causing problems on php page

         

esllou

12:42 pm on Jan 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a php/mysql search script in which I need to include some pop-up javascript (to take users to some search tips in a pop-up window). The js is causing the page not to load.

here is the relevant code:


<select name="slevel" class="">' . fillDropDown( $ddLevels ) . '</select>
</td>
</tr>
<tr>
<td>Keywords: </td>
<td>
<input type="test" name="skeywords" value="" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="a" value="' .$_APP['SearchButtonText'] . '" />
<a style="font-size:0.9em;" href="tips.shtml" target="popup" onclick="window.open('tips.shtml', 'popup', 'width=650,height=570,resizable=yes,scrollbars=yes'); return false">Search Tips</a>
</td>
</tr>
</table>
</form>

after a lot of testing, the exact problem is the ' character found six times in the window.open section. If I take those out, it loads but the pop doesn't work.

Does anyone know how I can get the js to work OR, alternatively, a php-friendly way of getting a pop to load?

thanks in advance...

vevs

3:14 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



I assume that you are doing this:

echo '<a style="font-size:0.9em;" href="tips.shtml" target="popup" onclick="window.open('tips.shtml', 'popup', 'width=650,height=570,resizable=yes,scrollbars=yes'); return false">Search Tips</a>'

just escape the '

echo '<a style="font-size:0.9em;" href="tips.shtml" target="popup" onclick="window.open(\'tips.shtml\', \'popup\', \'width=650,height=570,resizable=yes,scrollbars=yes\'); return false">Search Tips</a>'