Community Forums › Forums › Archived Forums › General Discussion › Page-Level Dropdown List?
- This topic has 5 replies, 2 voices, and was last updated 6 years, 11 months ago by
RavenManiac.
-
AuthorPosts
-
February 22, 2019 at 12:55 pm #489673
RavenManiac
ParticipantI'd like to create a page level drop-down list that redirects the user to a specific page when an item is selected. The drop-down would be inserted somewhere in a page.
Drop-Down List
Item 1 --> Page 1 URL
Item 2 --> Page 2 URL
Item 3 --> Page 3 URLIs there a specific plugin that would allow this or does this have to be custom coded?
Thanks!
http://page, drop-down, listFebruary 22, 2019 at 2:17 pm #489674Victor Font
ModeratorThis is easy to code. When you create your dropdown, you add a small jQuery snippet to the select element, like this:
<select id="urlSelect" onchange="window.location = jQuery('#urlSelect option:selected').val();">You setup the urls as the option values and the option text can be anything you like.
As soon as someone selects a page, the jQuery loads the page in the browser by changing the window.location. Here's a page where you can see this work. I did this along time ago, so don't judge. 🙂
https://victorfont.com/workshops/legal-consequences/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 24, 2019 at 12:11 am #489693RavenManiac
ParticipantThanks, Victor. Unfortunately, I don't even know how to code a dropdown. I'm assuming that's done in PHP, correct? Do you have a link to instructions?
February 24, 2019 at 11:51 am #489700Victor Font
ModeratorDrop downs are HTML forms. No PHP required unless you're reading from a database. View the source code on the example page I sent you, copy it, and make it your own.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 24, 2019 at 3:12 pm #489701RavenManiac
ParticipantHey Victor, I hadn't even considered using a form.
Do you think it's possible to use Ninja Forms Conditional Logic Add-on to redirect a user to a specific page based on the user's input into a text field?
For example, what if I set up a simple Ninja Form on a Client page with a single field that says, "Username" and a submit button. Depending on what the client enters, I want them to be directed to their client-specific password-protected page. It would work something like this:
Username: client1 --> redirects to Client 1 Password-protected page
Username: client2 --> redirects to Client 1 Password-protected page
Username: client3 --> redirects to Client 1 Password-protected pageDo you think that's possible with the Conditional Logic Add-on?
Thanks!
February 24, 2019 at 4:05 pm #489703RavenManiac
ParticipantVictor, you're a genius! Your form suggestion inspired me to try the Ninja Forms Conditional Logic Add-on and it worked perfectly!
It's a little slower than I'd like, but that's because it has to go through all of the conditions. This may not be the best solution long-term, but for right now it works great!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.