Jump to content
webchambers1

onclick to open in frame

Recommended Posts

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>

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.