Jump to content

How can I replace <input> boxes with their values?


DeX

Recommended Posts

Short question: How can I get a string of HTML code and replace all the <input> tags with their values?

 

Long question: I have a web page with a purchase order on it in HTML format and one or more of the columns is editable via input boxes. So the user can change the quantity/length of the material before submitting it. Once they choose to save it, it sends the string of HTML to a PDF generator (DOMPDF) which converts the HTML to a PDF file and saves it to the server. The user then has a hard copy of the purchase order PDF saved for each job. The problem is DOMPDF doesn't do well with <input> tags, it just leaves them as a blank space. So I want to take that string of HTML and replace all input boxes with their values before sending it to DOMPDF.

 

Currently I'm using Javascript to do just that when the user clicks to save the modified purchase order. The problem with this is it only works for when the user modifies the purchase order and saves a new modified copy. I need to save a base unmodified copy of it when the page loads so this would strip all the input boxes from the page as soon as it loads and the user would no longer be able to edit anything. So I need something to send the string to DOMPDF when the page loads but not modify what's on the page. Any ideas? Thanks.

Link to comment
Share on other sites

No, the input boxes are loaded with default values. I want to send it all to DOMPDF to create the base PDF file without any changes to it. I also want to give the user the ability to edit any of those fields and save it again.

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.