Jump to content

How can I pass <div> contents through a form?


DeX

Recommended Posts

I have a purchase order displaying on a site that the user can edit quantities for. I want them to be able to hit submit and it takes that form and submits it to some code that auto creates a PDF with it.

 

The PDF part is easy, I use DOMPDF to create that and it works fine, I just can't seem to get the values passed through. I can easily pass the values of just the input boxes through the $_POST but I don't want to have to recreate the PDF setup after the post. I'd rather just use some Javascript or something to grab the innerHTML of a <div> element and somehow make it available after the form is submitted so the PHP code can use it to send to DOMPDF.

 

The form submits to itself and I have a piece of code at the top of the page which will create the PDF, I just need the <div> contents and I'm done. How do I get it? I could set it into a hidden variable but the reason I'm not doing that is because for some reason when I assign the big table which contains the whole purchase order into the hidden variable and then try to print it, it comes out all messed up. I don't know why and I'd rather just find another way than attempt to figure that out.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.