• Resolved andycucca

    (@andycucca)


    Good evening,

    I have the rather complex need to do a custom search based on 2 forminator forms, that I can send you as an attachment, which are recalled in the following window https://www.romacittaperta.com/iscrizione-master/

    The logic to implement is the following:

    • in forminator form 1 (Ricerca del giocatore) the user can enter characters of his surname and press the search button
    • the function triggered by the search button must present a series of players present in a player database with the name starting from the characters entered in the form present in a local database
    • the function allows the choice of one of the players among those presented in the search
    • the choice of the player among those presented involves the transfer of the data corresponding to the chosen player from the database to the forminator form 2 (Iscrizione al torneo master), which at this point will have many of the input data automatically valorised

    I would need to understand how to create the input and output connections from my custom function to forms 1 and 2 of forminator.

    Thanks in advance for your support
    Best regards
    Andrew

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @andycucca ,

    If your functions can use variables in the query parameter key you can use this feature, as described here https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-values

    kind regards,
    Kasia

    Thread Starter andycucca

    (@andycucca)

    Well Kasia,

    Your suggestion is very useful in order to fill the data in the 2 form, thanks.

    Well Kasia,

    Your suggestion is very helpful to fill the data in form 2, thanks.

    However, to use the name field filled out in form 1 and pass it to a function that searches for the results, what could I use?
    A thousand thanks

    Andrew

    Hi @andycucca

    The solution you’re looking for will require additional search plugin, as Forminator will be not able to cover all those request.

    But let’s start from begening:

    1. First, you will need some tabs plugins, like this one https://wordpress.org/plugins/wp-expand-tabs-free/ and make 2 tabs. In the first tab, you will have a search that will allow end users to type names and after clicking it will redirect to the search results page. We will talk about the search plugin in point no.2. You can of course skip this tabs plugin if your site uses some page builder and have already some tabs feature. Another scenario will be to skip tabs fully and simply place both forms one by one. The first form is for search players, and the second form is to add players.
    2. As the Forminator plugin does not have a search feature, you will need an extra plugin, for example, https://wordpress.org/plugins/wp-extended-search/ which will allow you to search in specific categories. Of course, the Forminator search field allows you to search items from the list, but it cannot cover your request.
    3. Here Forminator appears. So this will be the 1st Forminator form (the 2nd form to fully cover the main request). https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#post-data-field With the post data field you can create a form that will allow you to add players to specific category posts, which will be later used by this search plugin mentioned in point no.2.

    Hope this helps.

    Kind Regards,
    Kris

    Thread Starter andycucca

    (@andycucca)

    Heelo Kris,

    Thanks for answerring …. I am not so confident about your solution, but I appreciate your help.

    Have a nice day

    Andrea

    Thread Starter andycucca

    (@andycucca)

    Greetings,
    I have come to the conclusion of writing a custom function, regarding forminator I only need a couple of pieces of information:

    • the function must be activated by pressing the button on the 1st form forminator-research-player-form-export.txt
    • the function must read the data present in the two fields of the form: number-1 and name-1 and transfer them as input variables to the function
    • the function processes the data and at the end must write in form 2
      forminator-registration-al-torneo-form-export.txt a series of data to fill the form, in particular: number-5, radio-2, name-1 and name-2
      I just need to understand how to manage the inout and output steps to make the custom function work

    Link to the export of the 2 forms:

    https://app.box.com/s/slqjsh65mg1gkf7rrid8ll76o7an88gf

    https://app.box.com/s/moleqb3pakp7e8koqt3ctr3dnzszg0fz

    At the end of the payment with stripe, I would need a hook to start a function for writing the data present in form 2 to a database.
    That’s all Thanks in advance for your help

    Have a good evening
    Andrew

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @andycucca,

    the function must be activated by pressing the button on the 1st form 

    You can use the forminator_form_ajax_submit_response & forminator_form_submit_response filters to invoke a function on submit.

    • the function must read the data present in the two fields of the form: number-1 and name-1 and transfer them as input variables to the function
    • the function processes the data and at the end must write in form 2
      forminator-registration-al-torneo-form-export.txt a series of data to fill the form, in particular: number-5, radio-2, name-1 and name-2
      I just need to understand how to manage the inout and output steps to make the custom function work

    I’m afraid, there isn’t any one-step solution that could be suggested if you are looking for custom coding.

    You can refer the following doc:

    https://wpmudev.com/docs/api-plugin-development/forminator-api-docs/

    And also our Git for more references regarding this:
    https://gist.github.com/wpmudev-sls/bebf7cea0672fa7cfa2931fff45be86d

    https://gist.github.com/wpmudev-sls/9c1afcfcccd33dc7c662a901d51ae302

    https://gist.github.com/wpmudev-sls/adb493e7154f135fdf04db883e18927a

    Kind Regards,

    Nithin

    Thread Starter andycucca

    (@andycucca)

    Thanks for your answer, it is very useful

    You can close the ticket now.

    Best regards

    Andrea

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Complex custom funztion with Forminator’ is closed to new replies.