I am new to Webflow and have searched the forums. I would like to ask for help in integrating forms produced in Webflow with my marketing system. I have seen the Aweber article. But my external code is different.
Below is the code I am given, I would love to get this working ASAP
Thanks in advance
Paul
<script>
function isValidPhone(phone_number)
{
var phone = phone_number.replace(/[\(\)\.\-\ ]/g, '');
if (phone == "") { return false;
} else if (isNaN(parseInt(phone))) { return false;
} else if (phone.length < 10 || phone.length >= 15) { return false;
} return true;
}
function isValidEmail(email)
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(reg.test(email) == false) { return false; } return true;
}
function checkForm(myForm) { var errors = "";
if (myForm.f_firstname.value == "") errors = "Please enter your First Name.\n";
if (!isValidEmail(myForm.f_email.value)) errors += "Please enter a Valid Email.\n";
if (errors != "") { alert(errors); return false; } else { return true; } }
</script>
<form action="http://exitus.theultimatesystem.com/ms/external" method="post" onSubmit="javascript:return checkForm(this);">
<input type="hidden" name="event" value="lp_form">
<input type="hidden" name="sub_event" value="visit1">
<input type="hidden" name="revisit_event" value="revisit1">
<input type="hidden" name="val_required" value="f_firstname,f_email">
<input type="hidden" name="category_id" value="66394">
<input type="hidden" name="campaign_id" value="9024">
First Name: <input name="f_firstname" type="text" maxlength="50" /><br/>
Last Name: <input name="f_lastname" type="text" maxlength="50" /><br/>
Email Address: <input name="f_email" type="text" maxlength="64" /><br/>
Phone Number: <input name="f_phone" type="text" maxlength="20" /><br/>
<input name="f_optin_exists" type="hidden" value="1" /> <input name="f_optin" value="1" type="checkbox" CHECKED />Yes! Please add me to your mailing list today!<br/>
<input name="Submit" type="Submit" value="Submit" />
</form>
The fields in the code they sent you are named liked f_firstname, f_lastname etc, so give your Webflow form input fields, the same names as used in the code.
I hope this helps. If not, please let me know – I’m happy to assist further! Cheers, Dave
The code also includes a check box that is ticked, which forms part of the ‘double Opt in’ How would I integrate this into the form. I am excited to have a great looking form that will opt people into my marketing system.
<input name="f_optin_exists" type="hidden" value="1" /> <input name="f_optin" value="1" type="checkbox" CHECKED />Yes! Please add me to your mailing list today!<br/>
I spoke with their dev and they do not have any other way of using the code they have provided
Hi @quittoo, thanks for your update I took a peek at the site and one thing to check is that you have the right url for the action property. See my screenshot, flip the urls around so that the url currently being used in the redirect is used for the action property and vice versa for the the redirect url. Check that, republish and try again and let me know how it works. I am happy to take a look further Cheers, Dave