You can start by creating a new form. In the "Edit form" you can enter these values:
- Form Title: Compare
- Form Name: Compare
- Email field 1 - Textbox
Name: email1
Caption: Email1
Required: Yes
Validation: Your validation message here
Click "Save" next to the component's settings - Email field 2 - Textbox
Name: email2
Caption: Email2
Required: Yes
Validation: email
Click "Save" next to the component's settings - Submit button
Name: compare
Caption: Compare
Reset: No
Additional Attributes: onclick="return checkEmail('email1', 'email2');"
Click "Save" next to the component's settings
The next step is to populate the form with the following components:
Go to the "CSS and Javascript" tab and paste the following code:
<script type="text/javascript">
function checkEmail(theForm) {
if (document.getElementById('email1').value != document.getElementById('email2').value)
{
alert('Those emails don\'t match!');
return false;
}
else {
return true;
}
}
</script>
Click "Save" and that's it.
0 nhận xét:
Đăng nhận xét