FormSubmit.co Redirect back to Contact Form if the provided email address is invalid or bypass email validation

Viewed 12

If someone fills out our contact form here: https://www.va.gov/homeless/landlords.asp but enters the wrong email address format, the page redirects the user to www.va.gov instead of back to the contact us form https://www.va.gov/homeless/landlords.asp. Is there a way to change this to redirect back to the contact form page or bypass the invalid email validation? Below is my current code for the form:

<header>
<h3 id="contact-us" style="text-align: left;">Contact Us</h3>
</header>
<div style="text-align: center;" id="multipart/form-data"><form action="https://formsubmit.co/HomelessVets@va.gov" method="POST"><input name="_captcha" type="hidden" value="false" /> <input name="_subject" type="hidden" value="New landlord submission!" /> <input name="_next" type="hidden" value="https://www.va.gov/homeless/landlord_thank_you_page.asp" />
<div style="text-align: left;" class="formgroup" id="name-form"><label for="name">Your Name*</label></div>
<div style="text-align: left;"><textarea id="name" cols="80" name="name" required="" rows="1.5"></textarea></div>
<div style="text-align: left;" class="formgroup" id="email-form"><label for="email">Your E-mail*</label></div>
<div style="text-align: left;"><textarea id="email" cols="80" name="email" required="" rows="1.5" placeholder="username@email.com"></textarea></div>
<div style="text-align: left;" class="formgroup" id="number-form"><label for="phone">Phone Number</label></div>
<div style="text-align: left;"><textarea id="phone" cols="80" name="phone" rows="1.5"></textarea></div>
<div style="text-align: left;" class="formgroup" id="website-form"><label for="website">Website</label></div>
<div style="text-align: left;"><textarea id="website" cols="80" name="website" rows="1.5"></textarea></div>
<div style="text-align: left;" class="formgroup" id="location-form"><label for="location">Location (City and State)*</label></div>
<div style="text-align: left;"><textarea id="location" cols="80" name="location" required="" rows="1.5"></textarea></div>
<div style="text-align: left;" class="formgroup" id="description-form"><label for="description">Description of Housing Available</label></div>
<div style="text-align: left;"><textarea id="description" cols="80" name="description" rows="5"></textarea></div>
<div style="text-align: left;" class="formgroup" id="requested-information-form"><label for="requested-information-form">Information Requested</label></div>
<div style="text-align: left;"><textarea id="requested-information-form" cols="80" name="requested-information-form" rows="5"></textarea></div>
<div style="text-align: left;" class="container"><a><button class="btn btn-primary btn-lg">Submit</button></a></div>
</form></div>
</div>
</div>
1 Answers

You sent HTML code so I assume you mean front-end validation. I suggest using type="email" for input so this will display information if email format is invalid:

<header>
    <h3 id="contact-us" style="text-align: left;">Contact Us</h3>
</header>
<div style="text-align: center;" id="multipart/form-data"><form action="https://formsubmit.co/HomelessVets@va.gov" method="POST"><input name="_captcha" type="hidden" value="false" /> <input name="_subject" type="hidden" value="New landlord submission!" /> <input name="_next" type="hidden" value="https://www.va.gov/homeless/landlord_thank_you_page.asp" />
    <div style="text-align: left;" class="formgroup" id="name-form"><label for="name">Your Name*</label></div>
    <div style="text-align: left;"><textarea id="name" cols="80" name="name" required="" rows="1.5"></textarea></div>
    <div style="text-align: left;" class="formgroup" id="email-form"><label for="email">Your E-mail*</label></div>
    <div style="text-align: left;"><input type="email" id="email" name="email" required="" placeholder="username@email.com"></div>
    <div style="text-align: left;" class="formgroup" id="number-form"><label for="phone">Phone Number</label></div>
    <div style="text-align: left;"><textarea id="phone" cols="80" name="phone" rows="1.5"></input></div>
    <div style="text-align: left;" class="formgroup" id="website-form"><label for="website">Website</label></div>
    <div style="text-align: left;"><textarea id="website" cols="80" name="website" rows="1.5"></textarea></div>
    <div style="text-align: left;" class="formgroup" id="location-form"><label for="location">Location (City and State)*</label></div>
    <div style="text-align: left;"><textarea id="location" cols="80" name="location" required="" rows="1.5"></textarea></div>
    <div style="text-align: left;" class="formgroup" id="description-form"><label for="description">Description of Housing Available</label></div>
    <div style="text-align: left;"><textarea id="description" cols="80" name="description" rows="5"></textarea></div>
    <div style="text-align: left;" class="formgroup" id="requested-information-form"><label for="requested-information-form">Information Requested</label></div>
    <div style="text-align: left;"><textarea id="requested-information-form" cols="80" name="requested-information-form" rows="5"></textarea></div>
    <div style="text-align: left;" class="container"><a><button class="btn btn-primary btn-lg">Submit</button></a></div>
</form></div>
</div>
</div>

If you meant back-end validation it depends on back-end language.

Related