Hey everyone,
Until Klemen gets this done, if you want a quick solution, you can use a bit of javascript. Let me walk you through what I have done for my client.
First, add the second email field to your form. On the index.php page, look for
Code: Select all
<form method="post" action="submit_ticket.php" name="form1" enctype="multipart/form-data">
A few lines below that you will find the email field. It looks like this
Code: Select all
<td style="text-align:right" width="150"><?php echo $hesklang['email']; ?>: <font class="important">*</font></td>
<td width="80%"><input type="text" name="email" size="40" maxlength="50" value="<?php if (isset($_SESSION['c_email'])) {echo stripslashes(hesk_input($_SESSION['c_email']));} ?>" /></td>
Enter the following code, immediately below the closing </td>tag. This adds the new email field to your form.
Code: Select all
<td style="text-align:right" width="150"><?php echo $hesklang['email2']; ?>: <font class="important">*</font></td>
<td width="70%"><input name="email2" type="text" id="email2" onblur="VerifyDataIsIdentical('email','email2')" value="<?php if (isset($_SESSION['c_email2'])) {echo stripslashes(hesk_input($_SESSION['c_email2']));} ?>" size="40" maxlength="50" /></td>
Please note that the reason I have references to "hesklang['email2']" is you need to place an entry in your text.php file. I will give you those instruction later in this post. There is a bit more code than you need in that paste, is because I plan on implementing that into a new MM_ValidateForm later, and I did not want to redo everything.
Next, place this javascript below the table that contains these three entries, on the line immediately below the table closing tag "</table>".
Code: Select all
<script type="text/javascript">
var d1pastval = new String();
var d2pastval = new String();
function VerifyDataIsIdentical(d1,d2) {
var d1val = document.getElementById(d1).value;
var d2val = document.getElementById(d2).value;
if(d1val.length &&
d2val.length &&
(d1val != d2val) &&
( (d1val != d1pastval) || (d2val != d2pastval) )) {
// alert message is between quotes on the next line. You may change this to any message you want. //
alert("E-mails must match");
d1pastval = d1val;
d2pastval = d2val;
return false;
}
return true;
}
</script>
This will only alert your user one time, immediately after they leave the second email field that the two do not match.
Next, open your language/en/text.php file and add the following
Code: Select all
$hesklang['email2']='Please confirm your E-mail';
You can add that anywhere in the file, but I added it at around line 130, just to keep data grouped together.
I hope this helps everyone. When I get the function MM_validateForm done, if Klemen does not object, I will post it here.