Javascript in php

I am trying to echo a javascript open window command into a php table. I suspect that my problems stem from improper quotes.

The javascript (not in php) that does what i want is

A HREF="javascript:void(0)"onclick="'','Contestnfo', 'width=600,height=700,menubar=no,status=yes')">Open a new window</A>
The eid=242 and instance =2011-4-16 are hard coded for this example, in the php code they will be variables. as will the name Open a new window.
I can get pretty much what I want with a target=’_blank’ command in the following line

echo "<td align='left'><a href='".$contest[$i]['id']."&instance=".$contest[$i]['event_inst'].", 0, 0' target='_blank' name='Contest Info'>".$name."</a>";

This works and opens a full new window, but I would prefer to do this with the javascript command. The variable $name is a row in my table that when clicked links to the pop up window with a specific id and instance (date)

This is part of a Thyme calendar project.

Thank you,

this works fine for me but I didn’t see the initial “<” in your javascript block, after I used that it worked fine.

<A HREF="javascript:void(0)"onclick="'','Contestnfo', 'width=600,height=700,menubar=no,status=yes')">Open a new window</A>

Sorry I guess I wasn’t clear, I was looking for the equivilent statement in php beginning with the echo statement.

Thank you

Sponsor our Newsletter | Privacy Policy | Terms of Service