Populating dropdown dynamically with entries.

Home Forums Quform WordPress Populating dropdown dynamically with entries.

This topic is: resolved
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #19474
    khangp
    Participant

    Hello fellow Quform fans and Ally!

    I searched the forums about populating dropdown menus. While I did find some related stuff, I couldn’t find exactly what I needed. Basically I’m wondering if there’s a way to populate a dropdown menu in a form with submitted entries from a different form submitted by specific users. It would also be ideal if entries that are a month old or older, do not show up.

    Any help would be appreciated!

    #19480
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19510
    khangp
    Participant

    Hello Ally! Thank you for getting back to me so quickly. I do apologize for the delay. After pondering over what I actually needed to accomplish, I realized that what I mentioned above was only part of what I needed. Let me give you a scenario and hopefully you can shed some light on this:

    A user will fill out a form in which the first field will be a text field named, for instance “Project Name”. After the form has been submitted, the user will be able to see the entries on their respective account page. I will be controlling the display of entries by using the CFDB plugin. When the user sees the entries, every row will have a link that says, for example “modify”. Clicking this will bring them to a new form. Ideally, the first field in this form will contain the project name they entered in the previously submitted form. This field should be visible, but not editable. Also, ideally, this form, which contains that specific project name should have a submission limit, e.g. three.

    I’m not sure if all of this is possible but if you can shed some light on what I would need to get this accomplished, that would be really appreciated.

    #19522
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19534
    khangp
    Participant

    Thank you for the thorough response Ally.

    I have noted the read only hack and hope to apply it as needed so thank you for that. I realized I’m making this more difficult than it needs to be. What if I simply wanted to populate a form in the above example with entries submitted by specific users?

    Thanks again for your help.

    #19543
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19544
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19549
    khangp
    Participant

    Thanks.

    So the idea is to have a form much like the one described in the above example. A logged in user will fill the form out and the first field will be something like “Project Name”. This will be a text field which the user will fill out. When the form is submitted, naturally, the entries will be saved in the database.

    The same user can now go to a completely different form which will have a drop down menu which will be populated using the “Project Name” data submitted in the previous form. These items should only be user-specific, so when the user goes to the second form, he will see only his own submitted project names.

    Hope that makes sense.

    Thanks

    #19559
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19572
    khangp
    Participant

    Thank you so much Ally!

    That information alone is enough to give me an awesome head start.

    While I have you, I wanted to know if you can shed light on another similar solution I found in the guides you folks created, namely the guide called “Populating a second form from data saved in the database”. This incorporates something extra, i.e. dynamic links (step 7). I wanted to know how difficult it would it be to produce a link that instead of being emailed is created on a separate area of the website upon form submission.

    So, for instance, when the form is submitted, a link is generated which incorporates the name of one of the fields like this: <a href="http://www.example.com/second-form?booking_id=530b2b113e417">My Submission 1</a>. The “My submission 1” is populated from a text field entry from the same form. I suppose a paragraph tag with a class can be used as a hook. You would advise best.

    Also, in that example, there is a “start date” and “end date”. If those fields are not part of my form, how does it affect the code?

    Thanks again for your excellent support.

    • This reply was modified 7 years, 8 months ago by khangp.
    #19578
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    • This reply was modified 7 years, 8 months ago by Ally.
    #19655
    khangp
    Participant

    Thanks Ally!

    You have been tremendously helpful in this regard. I have just right information to get this off the ground. I really appreciate your awesome support.

    Thanks again

    #19719
    khangp
    Participant

    Hello Ally.

    Thank you again for your awesome support. I wanted to get some clarification on the code you gave me above. I’m working on getting a database query developed. Here are a couple questions.

    1) Does the code account for displaying entries for that specific field for a specific user?
    2) For the form whose entry “Project Name” will be saved into the new table, should the table be created only to accommodate that field or should I simply save all the entries from that form into that new table?

    While I have you, I just wanted to express my goal. I’m trying to save certain data that I can use over and over again in different forms. “Project Name” happens to be one type but I may need to depend on other important data. Since I was doing this for one data type, I figured I should ask what would be the best route for all important entries. Should I store all of those in one table or create multiple tables for each type of data? Keep in mind that some entries will come from different forms and the population users will be their own submitted data.

    If you can shed some light on this, I would appreciate it.

    Thanks again!

    #19734
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19747
    khangp
    Participant

    Thank you Ally!

    So, the developer should be able to create a query that will populate the projects from a logged in user?

    In the example I gave you, the form would start out with the drop down field. However, what if I had a form that utilized two drop down fields: one being the User field and the other Project Name. The user field will display all of the users and upon selecting one, the Project Name drop down field will be populated with the respective projects. Can you modify the code so it takes into account this type of form?

    Thanks again.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy