• Resolved dfreidus

    (@dfreidus)


    Is there a way to have Forminator use a static ID for a field?

    Currently, a field has an HTML ID similar to this:
    forminator-field-street_address-address-1_6360f5ab28e00

    The part after the “_”, i.e. 1_6360f5ab28e00, changes every time that the form is refreshed. This makes it impossible to reference that particular field from elsewhere (I am trying to point a Google Maps Address plugin to this field).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @dfreidus,

    I hope you are doing well today!

    You can use Edit Field->Styling->Additional Class section and add unique class to the field you want to refer to.
    https://prnt.sc/DCB9eIGe9-bh
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#additional-css-classes

    Kind regards,
    Zafer

    Thread Starter dfreidus

    (@dfreidus)

    Hi Zafer

    Thank you so much for your response.

    Excuse my ignorance, but will that change the “ID” field. If so, what code should I use to do that?

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    HI @dfreidus

    It will not change the ID of the field or the field itself. It will add additional custom CSS class name (as you specify it) and that class will be “Fixed” – always the same for this field.

    I’m not quite sure what do you mean by “what code should I use for that” but you mentioned earlier that you want to reference the field from some other script/services. Having such custom class name set (as my colleague suggested) you’ll be able to do this the same way as if you’d reference original ID of the field – it just won’t change on its own upon each refresh of the page.

    Kind regards,
    Adam

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @dfreidus ,

    We haven’t heard from you for a week now, so it looks like you don’t need our assistance anymore.
    Feel free to re-open this ticket if needed.
    Kind regards
    Kasia

    Thread Starter dfreidus

    (@dfreidus)

    Hi Zafer, Adam and Kasia

    Thank you for your help on this. Sorry I didn’t reply sooner, but I have still not solved my problem on this. Perhaps I should be more specific.

    I am trying to get Google location autocomplete to work on an address field in my Forminator form.

    I have a plugin which can accomplish this. What you need to do is to identify the “ID” of the input field where you want the autocomplete to work, and then type this ID into the plugin.
    I have been unable to get this to work in Forminator at the moment as the ID field for the input keeps on changing whenever you refresh the form.

    Using the additional custom CSS doesn’t work either because the plugin looks up the “ID” field.

    I am not set on the way that this is done, but I would really like to get the autocomplete location working.

    Thanks again for your help.

    Thread Starter dfreidus

    (@dfreidus)

    I have managed to find a solution. I have used the following plugin:

    https://www.ads-software.com/plugins/address-autocomplete-using-google-place-api/

    which works perfectly as I am able to specify the name of the field instead of the ID.

    For those who need it, it can be downloaded here: https://wordpress.horje.com/wordpress-wp-5639-address-autocomplete-using-google-place-api.html

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Form Field ID’ is closed to new replies.