[Forminator Pro] Populating fields from other fields

Is it possible to set the value of a field based on what the user enters into another field?

For example, I'd like to use the post-making capability of the forms in forminator, but I have a specific format I want the titles in and I don't want to have to rely on the people filling in the form to get it right.

So, if I had some fields – titled "author name", "title", "subject of article", could I use the results of those fields to then have the post title fill in -"subject of article": "title" by "author name"

  • Jonjon
    • Site Builder, Child of Zeus

    Hi there Alicia.

    Hope you are doing great and thank you for reaching out to us.

    I have tried to apply what you described into Forminator PRO, but I'm afraid it's not supported by default at the moment. That is, to combine fields into one on real time.

    However, you can use a JavaScript workaround for that. I have provided an example below. What I did is link a JavaScript function to the event of changing the texts fields involved in building the title. The other thing I did was to make the post-title field readonly, so it can only be edited by modifying the other fields.

    Of course you can make this field invisible as well, but you will need knowledge in JavaScript coding to apply this script to your page in particular.

    <script type="text/javascript">
    jQuery( document ).ready(function($)
    {
    $("#postdata-1-post-title").prop("readonly", true);

    $('#text-2-field, #text-3-field, #text-4-field').change(function()
    {
    var title = jQuery('#text-4-field').val() + ": " + jQuery('#text-3-field').val() + " by "+ jQuery('#text-2-field').val();
    jQuery("#postdata-1-post-title").val(title);});
    });
    </script>

    Here is how it looks on my front-end:

    [attachments are only viewable by logged-in members]

    Hope to have helped.

    Best,

    Jon

  • Jonjon
    • Site Builder, Child of Zeus

    Hi there Alicia.

    Thank you for your feedback.

    I’m happy to say that this “calculations” of dynamic values is currently on the product road-map. I cannot give you an estimation right now of when, but it should be implemented in one of our future releases.

    Hope to have helped and thank you for choosing WPMUDEV :slight_smile:

    Best,

    Jon