webchambers1 Posted June 23, 2020 Share Posted June 23, 2020 Hi, I have a page that creates a pdf file the button saves the pdf to a file on my server then the onclick function i want to send the page to a frame called userframe. so Target=“userframe” i have tried putting this in different places in the code but it always opens up the page in a new tab ? Do not get confused with id printbtn this is NOT to open print dialog its just a name to gave to css class. my code <a id =“savepdf” href="invoice.php?invoice_id=<?=$invoiceID?>"value=“Save This Invoice”><button class=“block” id =“printbtn” onclick =“window.open(‘https://www.mywebsite.com’)”;>Save Invoice</a> Quote Link to comment https://forums.phpfreaks.com/topic/310984-onclick-to-open-in-frame/ Share on other sites More sharing options...
requinix Posted June 23, 2020 Share Posted June 23, 2020 Use one <a>. If you want it to look like a button then make it look like a button. Then add a target attribute to it. If that's still not working then post your current code. Everything that might be relevant. Not just the line with the link/button on it. Quote Link to comment https://forums.phpfreaks.com/topic/310984-onclick-to-open-in-frame/#findComment-1579096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.