Jump to content

Dropdown list selection to generate PDFs

Recommended Posts

Hi, so I have created a frontend page to allow user to select from dropdown list. Depending on dropdown textfields are shown to have them enter values. These 6 PDFs have different pages at the end of each of them (the first 5-6 pages are all the same in them and then the last 7 pages are all different based on which dropdown list is selected).

My question is what is the best way to code this:

Should I create 6 versions of the php file and call them based on what dropdown list selection is made?

Should I keep 1 php file and then check what selection is made (using if statements) and generate PDF? Wouldn't I have lots of repetition if I choose this method since in my code there is lots of formulas.


If someone can point me to how to accomplish either of these, that would be great.

Link to comment
Share on other sites

I'm confident that the less complicated one is the better solution.

In terms of code, all you need is something that can tell what option the user selected, and something that can do what it needs to do to give the user the PDF they requested.

Try writing the code yourself. If you have problems getting it to work then post what you have with a description of what you're trying to do and what problem(s) you're having with it.

  • Like 1
Link to comment
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.

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.