Home › Forums › Quform WordPress › Populating dropdown dynamically with entries.
- This topic has 15 replies, 2 voices, and was last updated 7 years, 7 months ago by Ally.
- AuthorPosts
- July 3, 2016 at 11:02 am #19474khangpParticipant
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!
July 4, 2016 at 6:09 pm #19480AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 12, 2016 at 12:53 am #19510khangpParticipantHello 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.
July 13, 2016 at 9:27 pm #19522AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 18, 2016 at 11:06 am #19534khangpParticipantThank 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.
July 18, 2016 at 8:21 pm #19543AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 18, 2016 at 8:25 pm #19544AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 19, 2016 at 8:36 am #19549khangpParticipantThanks.
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
July 20, 2016 at 7:06 pm #19559AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 26, 2016 at 7:54 am #19572khangpParticipantThank 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.
July 27, 2016 at 8:51 pm #19578AllySupport StaffYou 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.
August 12, 2016 at 2:17 am #19655khangpParticipantThanks 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
August 22, 2016 at 7:43 pm #19719khangpParticipantHello 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!
August 24, 2016 at 7:36 pm #19734AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 25, 2016 at 11:32 pm #19747khangpParticipantThank 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.
- AuthorPosts
- You must be logged in to reply to this topic.