Thanks to all for the input. I use IE6 for testing because it is still the most prolific browser. I also test the pages with Firefox 2+, Opera 9+ and Safari. The problem is with IE6. Below is the HTML with the javascript for form validation containing the "é" character (Hex 0xE9)(ANSI 0233). IE6 causes an error where the other browsers don't but still don't display the character properly. Just click on Submit, or the Reset buttons.
================================================== ===============
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/transitional.dtd">
<html>
<head>
<title>Test</title>
<meta name="generator" content="HTML Tidy for Windows (vers 6 November 2007), see www.w3.org">
<meta name="generator" content="Textpad version 5.0.3 - http://www.textpad.com">
<meta name="robots" content="noindex, noarchive">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="650">
<!-- start form validator -->
<script type="text/javascript" src="Test.js"></script>
</head>
<body>
<table class="main" width="650" id="policy" align="center" summary="policy">
<tr>
<td class="grey" align="center" colspan="2"></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="10" cellspacing="20" align="center" summary="external links">
</table>
</td>
</tr>
</table>
<br>
<form name="Test_form" method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="form_username" value="">
<input type="hidden" name="source_document" value="Gestion des donnees d'adresse">
<br>
<table class="main" width="650" align="center" id="quote_request" summary="quote_request">
<tr>
<td>Société</td>
<td><input class="flat" type="text" name="company" id="company" value="" size="70" maxlength="70"></td>
</tr>
<tr>
<td>Courriel</td>
<td><input class="flat" type="text" name="email_address" id="email_address" value="" size="70" maxlength="70">
</td>
</tr>
<tr>
<td>Attachez le fichier<br>de données</td>
<td><input class="flat" type="file" name="myform_file" size="70" maxlength="100" id="form_file"></td>
</tr>
<tr>
<td>Quantité<br>approximative</td>
<td><input class="flat" type="text" name="quantity" id="quantity" value="0" size="10" maxlength="10"></td>
</tr>
<tr>
<td>Requis par</td>
<td><input class="flat" type="text" name="requiredby" id="requiredby" value="" size="25" maxlength="25"></td>
</tr>
</table>
<br>
<table align="center" id="submit_reset" summary="submit_reset">
<tr>
<td align="center"><input type="reset" id="reset" value="Effacer" onclick="advanced_selected(this.form)"></td>
<td align="center"><input type="submit" id="submit" value="Soumettez la demande" onclick="return check_form_fields(this.form)"></td>
</tr>
</table>
</form>
<br>
<br>
<br>
</body>
</html>[/HTML]
================================================== ===============
Test.js
================================================== ===============
- function check_form_fields(form)
-
{
-
var ValidChars = "0123456789";
-
var IsNumber = true;
-
var Char;
-
var i;
-
var today = new Date();
-
if (form.company.value == "")
-
{
-
alert("Veuillez indiquer le nom de societé!");
-
form.company.focus();
-
return false;
-
}
-
if (form.email_address.value == "")
-
{
-
alert("Veuillez indiquer votre adresse courriel!");
-
form.company.focus();
-
return false;
-
}
-
if(form.quantity.value < "1")
-
{
-
alert("Veuillez indiquer la quantite approximative!");
-
form.quantity.focus();
-
return false;
-
}
-
for (i = 0; i < form.quantity.value.length && IsNumber == true; i++)
-
{
-
Char = form.quantity.value.charAt(i);
-
if (ValidChars.indexOf(Char) == -1)
-
{
-
IsNumber = false;
-
alert("Veuillez indiquer la quantite approximative!");
-
form.quantity.focus();
-
return false;
-
}
-
}
-
if (form.requiredby.value == "" || form.requiredby.value == "None")
-
{
-
alert("Veuillez indiquer la date requise!");
-
form.requiredby.focus();
-
return false;
-
}
-
var dt_input = form.requiredby.value;
-
var input_year = dt_input.substring(0,4);
-
var input_month = dt_input.substring(5,7)-1;
-
var input_day = dt_input.substring(8,10);
-
var date_input = new Date(input_year, input_month, input_day);
-
date_input.setHours(23);
-
if (date_input < today )
-
{
-
alert("La date ne peut pas etre plus tot qu'aujourd'hui!");
-
form.requiredby.focus();
-
form.requiredby.value = "";
-
return false;
-
}
-
return true;
-
}