HurricaneDigital Posted May 26, 2010 Share Posted May 26, 2010 Trying to make this work, but can't figure out the quotation rules. One site mentioned something about \ xxx \ as an additional means of enclosing something. My button shows up but it doesn't work, just causes a page error. It works fine as plain HTML. I want it inside the PHP code so the buttons line up. <input type="button" onclick="window.location.href='form.php'" value="Add Work Order"></input> echo "<input type='button' onclick='window.location.href=?form.php?' value='Add Work Order'></input>\"; PS. I don't actually have question marks around form.php Link to comment https://forums.phpfreaks.com/topic/202925-single-double-quotations-in-echo-with-onclick/ Share on other sites More sharing options...
kenrbnsn Posted May 26, 2010 Share Posted May 26, 2010 Why do you have the backslash before the last double quote? Try <?php echo "<input type='button' onclick='window.location.href=\"form.php\"' value='Add Work Order'></input>"; ?> Ken Link to comment https://forums.phpfreaks.com/topic/202925-single-double-quotations-in-echo-with-onclick/#findComment-1063408 Share on other sites More sharing options...
HurricaneDigital Posted May 26, 2010 Author Share Posted May 26, 2010 Oops, that extra \ was a typo on my part when I was posting. That solved it though, the \". Thanks very much! Link to comment https://forums.phpfreaks.com/topic/202925-single-double-quotations-in-echo-with-onclick/#findComment-1063416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.