I'm trying to make a form (Gravity Forms) that will dynamically adapt to the input from the user. In my case a user can choose a school from a predefined list (School type, built with Toolset) or decide that his/her school isn't in our database (yet). The user then chooses the option "Other school" and fills in the necessary details of that school. That's easy enough. But the other thing I'd like to do is the fill in the details when a user chooses a school. So that when a user chooses school A, the details are filled in (and made readonly).
I think that I would need an Ajax-call from the Gravity Forms to Toolset PHP-code, but I was hoping there would be an example somewhere.
If you have no example that involves Gravity Forms, do you have a generic example that shows how to do Ajax-calls?
Thanks in advance!
Michiel
Hello Michiel and thank you for contacting the Toolset support.
Toolset Forms allow you to submit content from the frontend and save it to the database. But this requires you to use a Toolset Form. There is no way to submit data from another type of form (Gravity, or vanilla PHP) and use the Toolset Forms code to save the data.
So, I wonder why would you use a Gravity form instead of Toolset form 🙂
Maybe, if I understand your use case better, I might suggest a way of handling it. Would you elaborate more on it?
We do not have any example of generic AJAX calls, but you can find many examples online hidden link
Hi Jamal,
Thanks!
There are a number of reasons why I'm not using Toolset Forms:
1. The client has asked me to use Gravity Forms (they could be convinced to use Toolset Forms, but then I need to show them the advantages).
2. Gravity Forms has many more layout and UI options to make more attractive forms.
3. Toolset Forms doesn't work on my site. See: https://toolset.com/forums/topic/toolset-form-doesnt-work-show-on-page/
To see the differences, have a look at these to pages:
1. Gravity Forms
hidden link
2. Toolset Forms
hidden link (Hmmm.... seems to work now.)
What exactly would you want me to elaborate on?
Another thing I cannot do with Toolset Forms is make a conditional group based on the value of a Relationship or a Taxonomy in the same form.
Hello Michiel, I can understand that Gravity Forms provides more control over the design than Toolset. Especially for non-developers. For example, Toolset Forms do not have a form wizard yet such as the one provided by Gravity forms.
I just want to add, that Gravity form has some add-ons to let you create posts directly similarly to Toolset forms. But Gravity forms handle some custom fields types differently than Toolset(checkboxes, radios, etc...) and to make sure that Toolset will work with the newly created posts from Gravity forms, you might need to have some custom code for integration.
Toolset forms can, actually, let you create conditional groups. In fact, the expert mode for Toolset Forms can give you almost total control over what you will want to do.
I hope this answers your questions. Let me know if you have any doubts or any other questions.
Hi Jamal,
Thanks. I'm willing to give Toolset Forms another chance if you can point me in the right direction as to how to program a date field: disable weekends, allow only dates a week from now, etc. It took me 15 minutes to program that in Gravity Forms.
Cheers,
Michiel
Hello Michiel, that's awesome!
We use jQueryUI Datepicker for the date field and we can add custom Javascript code to the form. Check these previous tickets where users customize how the date picker works:
- https://toolset.com/forums/topic/disable-the-past-date-on-datepicker/#post-1083041
- https://toolset.com/forums/topic/disable-certain-datepicker-dates-depended-on-another-datepicker-value/#post-330695
- https://toolset.com/forums/topic/set-min-date-for-end-date-greater-start-end-selection/
And for disabling weekends, check this thread on StackOverflow https://stackoverflow.com/a/503082
I am sure you will be able to come up with a working solution. Let me know if you will need assistance with this.
Thanks! I will have a look. Also Gravity Forms uses the jQueryUI DatePicker, so this shouldn't take too much time.
Awesome 🙂 And thank you for your feedback.
I'll set this ticket status to "I think it's resolved" it should be kept open for 3 days.
For support rules, we are able to handle only one issue at the time. This helps us to bring you a better service and also helps other users to find all the information here exposed. For that reason, I'll suggest opening a new ticket for anything else.
We can also continue on this ticket if you think that your original question is not yet answered.
All the best!
My issue is resolved now. Thank you!
Follow-up question: I'm trying to create a contact page where visitors can contact one of the companies on my site. I would like to give them a list of the companies available when they come straight to the contact page (which is easy, I have that). But when they come from the page of a specific company, I'd like the company to be filled in already. Any ideas on how to do that?
Thanks!