Support » Plugin: HTML Forms » Set Action Per Form?

  • Resolved Daniel Hendricks

    (@hendridm)


    Greetings,

    I’m currently using the hf_form_element_class_attr filter to set the form action. However, I was wondering if it’s possible to set it on a per-form basis?

    Perhaps either with this or other filter, or perhaps a shortcode attribute, like:
    [hf_form slug="myform" action="https://www.example.com/"]

    Thank you,
    Daniel

Viewing 1 replies (of 1 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi Daniel,

    Can you please let us know why you want to modify the form action?

    Changing it could potentially break the server-side logic of HTML Forms that is capturing the form submission. That’s why I’m hesistant to offer an easy way to change it.

    Also, please know that the filter hook hf_form_element_class_attr does not allow you to set the form action attribute. It is used to set an array of CSS classes to add to the form (so inside the class="..." attribute).

    If you really want to modify the form action then you can use the hf_form_element_action_attr filter instead, but be careful in doing it as pointing it to a non-WordPress powered URL could break the plugin.

    Let us know please. Would love to see if there’s a better way to go about this and/or facilitate your use case.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.