Upcoming Maintenance - October 21st at 8PM: Please note that our service will be temporarily interrupted for some maintenance for about 3 hours on October 21st starting at 8PM EDT. During this period, the application will be inaccessible and some statistics may not be compiled. Also, some functionalities may be interrupted and any scheduled emails will be sent once the service is restored.
Close
Security Notice - PHP Vulnerabilities Patched: Following the recent announcement of critical PHP security vulnerabilities, our technical team took action as soon as the security update was released. The necessary fixes have been applied to our infrastructure, and the update is complete.
Close

Code example: add a simple validation on the fields

It is possible to add validation on the HTML code to help the user to complete the form. For example, adding the required attribute to a field will return a message when submitting the form if that field is left blank. You can also use CSS to display the invalid fields differently.

<form action="https://app.cyberimpact.com/optin" method="post" accept-charset="utf-8">
...
<label for="ci_firstname">First Name</label>
<input type="text" id="ci_firstname" name="ci_firstname" maxlength="255" required />
</form>
<style>
input:invalid { border: 2px dashed red; }
</style>

You'll find a more complete reference on the Mozilla website. Note that this method can be overridden, but it usually gives good results.

Top