glad to help, come back anytime.
Funny you should say that :)
The form works a treat when I preview in Frontpage, but as soon as preview through browser (IE6), the thing falls over, it doesn't run the mandartoy field check at all and subequently doesn't collapse the form!! Yet it functions perfectly when previewed in Frontpage.....
The Internet Option 'Use Java' is enable in and it runs other javascripts within the form work fine!
Here's a cut down version again, nothing stands out to me though...
- <html>
-
-
<script>
-
function clientSideInclude(id, url) {
-
var req = false;
-
// For Safari, Firefox, and other non-MS browsers
-
if (window.XMLHttpRequest) {
-
try {
-
req = new XMLHttpRequest();
-
} catch (e) {
-
req = false;
-
}
-
} else if (window.ActiveXObject) {
-
// For Internet Explorer on Windows
-
try {
-
req = new ActiveXObject("Msxml2.XMLHTTP");
-
} catch (e) {
-
try {
-
req = new ActiveXObject("Microsoft.XMLHTTP");
-
} catch (e) {
-
req = false;
-
}
-
}
-
}
-
var element = document.getElementById(id);
-
if (!element) {
-
alert("Bad id " + id +
-
"passed to clientSideInclude." +
-
"You need a div or span element " +
-
"with this id in your page.");
-
return;
-
}
-
if (req) {
-
// Synchronous request, wait till we have it all
-
req.open('GET', url, false);
-
req.send(null);
-
element.innerHTML = req.responseText;
-
} else {
-
element.innerHTML =
-
"Sorry, your browser does not support " +
-
"XMLHTTPRequest objects. This page requires " +
-
"Internet Explorer 5 or better for Windows, " +
-
"or Firefox for any system, or Safari. Other " +
-
"compatible browsers may also exist.";
-
}
-
}
-
</script>
-
-
<script type="text/javascript">
-
<!--
-
function validateDate(fld) {
-
var RegExPattern = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/;
-
var errorMessage = 'Please enter valid date as DD/MM/YYYY';
-
if ((fld.value.match(RegExPattern)) && (fld.value!='')) {;
-
} else {
-
alert(errorMessage);
-
fld.focus();
-
}
-
}
-
//-->
-
</script>
-
-
<script type="text/javascript">
-
<!--
-
-
function changeDiv(the_div,the_change)
-
{
-
var the_style = getStyleObject(the_div);
-
if (the_style != false)
-
{
-
the_style.display = the_change;
-
}
-
}
-
-
function hideentype()
-
{
-
changeDiv("enrolment_type","none");
-
-
}
-
-
function hidedips()
-
{
-
changeDiv("dips_questions","none");
-
-
}
-
-
function hideas400()
-
{
-
changeDiv("as400_questions","none");
-
-
}
-
-
function hidenotes()
-
{
-
changeDiv("Lotus_Notes","none");
-
-
}
-
-
function hideems()
-
{
-
changeDiv("EMS_Group","none");
-
-
}
-
-
function getStyleObject(objectId) {
-
if (document.getElementById && document.getElementById(objectId)) {
-
return document.getElementById(objectId).style;
-
} else if (document.all && document.all(objectId)) {
-
return document.all(objectId).style;
-
} else {
-
return false;
-
}
-
}
-
// -->
-
</script>
-
-
<head>
-
-
<SCRIPT LANGUAGE="JavaScript">
-
<!-- Limit the size of Additional Notes Box -->
-
<!-- Begin
-
function textCounter(field, countfield, maxlimit) {
-
if (field.value.length > maxlimit) // if too long...trim it!
-
field.value = field.value.substring(0, maxlimit);
-
// otherwise, update 'characters left' counter
-
else
-
countfield.value = maxlimit - field.value.length;
-
}
-
// End -->
-
</script>
-
-
-
<script>
-
function toggle_display() {
-
var form = document.getElementById('hidesubmit');
-
var submit = document.getElementById('submit_group');
-
((form.checked)? submit.style.display='block': submit.style.display='none');
-
}
-
</script>
-
-
-
<script>
-
function toggle_form() {
-
var form = document.getElementById('e_form');
-
var thanks = document.getElementById('THANKS');
-
form.style.display ='none';
-
thanks.style.display='block';
-
}
-
</script>
-
-
-
<script>
-
<!--
-
-
function formCheck(formobj){
-
// Enter name of mandatory fields
-
var fieldRequired = Array("Manager_Name", "Manager_Email", "Date_Required", "Surname", "Forename", "Tel_No", "Job_Title", "Job_TitleW", "Section", "SectionW");
-
// Enter field description to appear in the dialog box
-
var fieldDescription = Array("Managers Name", "Managers Email", "Date Required", "Surname", "Forename", "Telephone Number", "Job Title", "Welsh Job Title", "Section", "Welsh Section");
-
// dialog message
-
var alertMsg = "Please complete the following fields:\n";
-
-
var l_Msg = alertMsg.length;
-
-
for (var i = 0; i < fieldRequired.length; i++){
-
var obj = formobj.elements[fieldRequired[i]];
-
if (obj){
-
switch(obj.type){
-
case "select-one":
-
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
-
alertMsg += " - " + fieldDescription[i] + "\n";
-
}
-
break;
-
case "select-multiple":
-
if (obj.selectedIndex == -1){
-
alertMsg += " - " + fieldDescription[i] + "\n";
-
}
-
break;
-
case "text":
-
case "textarea":
-
if (obj.value == "" || obj.value == null){
-
alertMsg += " - " + fieldDescription[i] + "\n";
-
}
-
break;
-
default:
-
}
-
if (obj.type == undefined){
-
var blnchecked = false;
-
for (var j = 0; j < obj.length; j++){
-
if (obj[j].checked){
-
blnchecked = true;
-
}
-
}
-
if (!blnchecked){
-
alertMsg += " - " + fieldDescription[i] + "\n";
-
}
-
}
-
}
-
}
-
-
if (alertMsg.length == l_Msg){
-
toggle_form();
-
}else{
-
alert(alertMsg);
-
return false;
-
}
-
-
}
-
-
// -->
-
</script>
-
[html]
</head>
<body>
<div id="THANKS" style="display:none;">
<table border="0" width="72%" id="table25">
<tr>
<td align="center" width="887">
<img border="0" src="_borders/conwyLogo.gif" width="97" height="64" align="right"></td>
</tr>
<tr>
<td align="center" width="887">Thank you for submitting an
e-Enrolment Form.</td>
</tr>
<tr>
<td align="center" width="887">You may now
<a href="#" onClick="window.close();">Close</a> this window.</td>
</tr>
</table>
</div>
<form method="post" action="mailto:my@mail.work?subject=EnrolReq" enctype="text/plain" subject="New User" name="FrontPage_Form1" onsubmit="return formCheck(this);" id="e_form" language="JavaScript" style="display:block;"> </div>
<table border="0" width="72%" id="table4" height="82">
<tr>
<td align="right" width="37%">
<font size="2">Name:</font></td><td align="left" width="62%"> <input type="text" name="Manager_Name" size="36" tabindex="1"><fontcolor="#FF0000">*</font></td>
</tr>
<tr>
<td align="right" width="37%">
<font size="2">Job Title:</font></td>
<td align="left" width="62%">
<input type="text" name="Manager_Job_Title" size="36" tabindex="2"></td>
</tr>
<tr>
<td align="right" width="37%">
<font size="2">Email Address:</font></td>
<td align="left" width="62%">
<input type="text" name="Manager_Email" size="36" tabindex="3"><font color="#FF0000">*</font></td>
</tr>
<input type="checkbox" name="agreecheck" id="hidesubmit" value="Agreed" onClick="toggle_display();"/>
By placing a check in the box you are agreeing to the above Access Authorisation Statement.</font></b></p>
<div id="submit_group" style="display:none;">
<table border="0" width="70%" id="table22" bgcolor="#CCFFFF">
<tr>
<td>
<p align="center"><font size="2">You may now click the SUBMIT button to
submit your e-Enrolment.</font><p align="center"><font size="2">When you click SUBMIT a screen will pop up indicating a program is sending an Email on your behalf.<br>
<b>You must click YES to submit the form.</b></font></td>
</tr>
</table>
<p>
<input type="hidden" name="EOR" value="">
<input type="Submit" value="Submit!">
<input type="reset" value="Clear Form">
</p>
</div>
</form>
<p> </p>
<p> </p>
</body>
</html>[/HTML]
Is it anything to do with the script being outside the <head> tag?? I'm clutching at straws here....