I'm messing with some javascript code that creates a popup that takes HTML code as a parameter and displays using innerhtml. It disables and covers the background. Before I try to explain all my code. My problem is simply I have a php script that displays a table cell with a link to open the popup.
$html = "<form name='form1' method='post' action='proc.php'><table><tr><td>Email:</td><td><input name='email' type='text' id='email' value=''></td></tr><tr><td>Password:</td><td><input name='mypassword' type='password' id='mypassword' value=''></td></tr><tr><td></td><td><input name='pkey' type='hidden' id='id' value=''><input type='submit' name='Submit' value='Submit'></td></tr></table></form><br><a href='javascript:afilter(7,31,2010)' onMouseOver=' return changeImage(4)' onMouseOut= 'changeImageBack(4)'>Close2Submit</a>";
$timelist .= "<td width='$w' height='50px' valign='top' onMouseOver=\"this.className='mouseover'\" onMouseOut=\"this.className='mouseout'\"><a href='javascript:Popup($html,'OK',null,'Cancel',null);'>Link</a></td>";
-
- $html = "<form name='form1' method='post' action='proc.php'><table><tr><td>Email:</td><td><input name='email' type='text' id='email' value=''></td></tr><tr><td>Password:</td><td><input name='mypassword' type='password' id='mypassword' value=''></td></tr><tr><td></td><td><input name='pkey' type='hidden' id='id' value=''><input type='submit' name='Submit' value='Submit'></td></tr></table></form><br><a href='javascript:afilter(7,31,2010)' onMouseOver=' return changeImage(4)' onMouseOut= 'changeImageBack(4)'>Close2Submit</a>";
-
-
- $timelist .= "<td width='$w' height='50px' valign='top' onMouseOver=\"this.className='mouseover'\" onMouseOut=\"this.className='mouseout'\"><a href='javascript:Popup($html,'OK',null,'Cancel',null);'>Link</a></td>";
-
It seems that when the table cell is displayed it shows the $html content automatically inside the cell instead of ONLY the Link button which when clicked should open a popup (which really just creates a div id and displays innerhtml to it). In fact, the Link button doesn't even work. On display it prints Close2Submit"','OK',null,'Cancel',null);'>Link and if I hover over the Submit button is says "javascript:Popup(" (no quotes). The $html is what I'm testing with an will not be the actual table I want to display on the popup but I figured if that $html content worked then any should.
I've tried using onclick for the A element with # and void etc. Why is the javascript firing without a user click? Or it may not be firing just displaying, but I've looked through all my quotes and apostrophes but I can't sort it out.