Dynamic Page generation with User Input & Submit Button (and PDF)

Hello,

I am trying to have a visitor (not a member) to my website enter their “Callsign”, push a submit button and generate a certificate for them that shows their particular accomplishments.

I have spent a lot of time trying to find an example, but no luck. I believe the solution involves WIX code (like the wix-router I am guessing). But I need help as I am not a WIX coder.

On my site I have:
Home
2016-Certificates Pages (Dynamic)
2016_Certificates (Callsign)
Database
2016_Certificates

When I preview 2016_Certificates (Callsign), everything works fine. I have two example callsigns and can create a certificate for both Callsigns.

Back on the Home page, I have a button with a link set to a page: Which page? Set to 2016-Certificates Pages (Dynamic), Which item? Set to one of the callsigns in the database. When I preview on the Home page and push the button, the desired certificate is created for the callsign associated with the button. Simple enough.

I could make this work, but I would need to create a button for every callsign entry in the database and have hundreds of callsign buttons on the Home page. Not a good solution. A dropdown box with hundreds of dropdowns would likewise not be a good solution.

What I want is for a visitor (not a member) to my Home page to be able to enter their Callsign, push a submit button, and have their certificate generated for them. No security is needed, as all of the information on the certificate is public anyway, and nobody cares if someone were to generate a certificate that was not theirs.

After I learn of a solution to the above problem, my next desire is to be able to create a pdf file of the certificate. Help on the pdf generation is also welcome!

Thanks in advance for any help!
Bill

Hey Bill,

What exactly do you mean when you say you the visitor to be able to enter their Callsign?
Do each of the Callsigns have a unique id/title that the visitor knows? And the visitor can type that into a text input?
Also, if you’re comfortable with it, sharing a link to your site might help.

Thanks,
Itai

Hi Itai,

Thanks for your reply.

Yes, each “callsign” or title is know by the site visitor, as the callsign belongs to them (think ham radio).
Yes the visitor could alternately type their callsign into a text input.

The link below shows the workaround I am using. It works, but obviously a text input box and a submit button is a better solution. Follow the instruction on the page, and replace “Callsign” in the URL with a valid callsign (one that is in the database & used to create the dynamic page). Try W7AI or K7ABC .

https://www.azqsoparty.org/certificate

Thanks again,
Bill

Ok cool,
With a pretty simple code I think you can achieve something pretty good.
Add a text input and a submit button, and try the following code:

import wixLocation from 'wix-location';

$w.onReady(function() {
  $w('#mySubmitButton').onClick(function () {
    const callsign = $w('#myTextInput').value;
    wixLocation.to("/Certificate-2017/" + callsign);
  });
});

Please try it and let me know how it goes.
Good Luck,
Itai

Itai,

Fantastic! I even got two buttons working.

Thanks much Itai!
Good luck to you,
Bill