Home>Support>How to use the Id field of the button in the form?

How to use the Id field of the button in the form?

Good Morning.

I’m trying to get a redirect to a response page when a user submits a form. I have seen that the ID field of the button exists, but even including a javascript the redirection does not work.

Could you tell me how to use this field correctly?

A greeting.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 5 years, 6 months ago Alex S
    Hi, I Work Here

    Hi Jmrdelgado,

    It’s not possible to use either the id field or the onclick field to redirect the contact form because the contact form submits after the page has been submitted so redirecting before then will result in the contact form not sending.

    To redirect after the contact form has been submitted and you’ll need to add some PHP to your website. I’d like to help you with doing this, but unfortunately, this is beyond the scope of the support we’re able to offer on our free forums. There is a fair amount of custom work involved.

    We do offer this level of support to our premium users, so if you’d like to upgrade to SiteOrigin Premium, then I can help you over email support.

    If you’d prefer not to upgrade to SiteOrigin Premium, then you can hire a WordPress developer from Codeable. They’ll charge you an hourly rate for any work done.

  2. 5 years, 6 months ago jmrdelgado

    Hi Alex.

    Thanks for your answer.

    Could you tell me then what is the purpose of the ID fields of the button and WHEN CLICKING?

    A greeting.

  3. 5 years, 6 months ago Alex S
    Hi, I Work Here

    Hi Jmrdelgado,

    The ID button allows you to set up event tracking or other code that doesn’t result in a redirect.

  4. 5 years, 6 months ago jmrdelgado

    Hi Alex.

    ¿And what purpose has the field that indicates what to do after pressing the button and that allows you to enter javascript.?

    Despite entering javascript code in this field, it does not run.

    This field does not work ?.

    A greeting.

  5. 5 years, 6 months ago Alex S
    Hi, I Work Here

    Hi Jmrdelgado,

    Can you please link me to the page your contact form is on so I can take a closer look at it? That will allow me to work out why your JavaScript isn’t running.

  6. 5 years, 6 months ago jmrdelgado

    Good morning Alex

    The url of the form is: https://preproduccion.openges.es/tu-lado-rebelde-landing/

    You can find it in the lower area.

    If you inspect the button you will see that the script is correctly assigned to the button but it does not execute it.

    and the javascript I’m using is a basic window.open (https: ….)

    A greeting.

  7. 5 years, 6 months ago Alex S
    Hi, I Work Here

    Hi Jmrdelgado,

    Thanks. The JavaScript you’ve added to the button is currently invalid. You need to wrap the URL in your JavaScript in quotes. Once this issue is corrected, the JavaScript will execute on click without issue.

  8. 5 years, 6 months ago jmrdelgado

    Hi Alex.

    Thank you very much for your help. Now the load of the page to redirect works.

    However, I would like the url that opens to be opened on the same tab. I have looked at the documentation of Window.open and even when I indicate the parameter _self the page opens in a new window.

    Which may be due?

    A greeting.

  9. 5 years, 6 months ago Alex S
    Hi, I Work Here

    Hi Jmrdelgado,

    I’d like to help you with this, but unfortunately, this is beyond the scope of the support we’re able to offer on our free forums. We’re not able to assist with these sort of issues as there’s a lot of custom work involved.

    We do offer this level of support to our premium users, so if you’d like to upgrade to SiteOrigin Premium, then I can help you over email support.

    If you’d prefer not to upgrade to SiteOrigin Premium, then you can hire a WordPress developer from Codeable. They’ll charge you an hourly rate for any work done.

  10. 5 years, 6 months ago jmrdelgado

    Hi Alex

    Thank you so much for everything.

    A greeting.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More