I have a form that works like a charm - as long as you are not using Internet Explorer!
I made a new form (below, a *.php file) to show you how VALIDATION (two 'types') is failing in IE... Neither of the validations work in IE...
I tried to change the type="image" to a very simple type="submit" for the form submittal --- and a heck of a lot more things have been tried...
What am I missing?
I am primarily a scientific data analysis guy, geologist, self taught in all this - shows huh? <wink> - so please assume I am missing the easy stuff <smile>
Thanks in advance...
GREG...
Expand|Select|Wrap|Line Numbers
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>DELETE Page - Test Form - Bloody Internet Explorer</title>
- <script src="/SpryValidationTextField.js" type="text/javascript"></script>
- <link href="/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
- <!-- form related javascript -->
- <script language="javascript" type="application/javascript">
- var errorsOnSubmit = function(form)
- {
- var ret = Spry.Widget.Form.validate(form);
- var errorZone= document.getElementById('error_zone');
- if (!ret)
- {
- errorZone.style.visibility = 'visible';
- errorZone.style.backgroundColor = 'red';
- }
- else
- {
- errorZone.style.visibility = 'hidden';
- };
- return ret;
- };
- //validate the specific (sic) of the incident reporting form contents
- function validate_try_simple_form_ie()
- {
- alert('Specific validation fired...');
- //make sure my name is not used
- if(document.try_simple_form_ie.txt_full_name.value == 'Greg Cocks')
- {
- alert('Don\'t use my name!');
- document.try_simple_form_ie.txt_full_name.value = "";
- document.try_simple_form_ie.txt_full_name.focus();
- return false;
- };
- //check out OK
- return true;
- };
- </script>
- </head>
- <body>
- <h1 style="text-align:center;color:red">
- DELETE Page - Test Form - Bloody Internet Explorer - 22
- </h1>
- <p>
- Form functionality that works like a charm in Chrome, Firefox, etc - but the Spry and the 'custom' validation does not work in IE!!
- </p>
- <form action="<?php print $_SERVER['PHP_SELF']; ?>" method="post" name="try_simple_form_ie" id="try_simple_form_ie" onsubmit="return errorsOnSubmit(this);" >
- <input type="hidden" name="_try_simple_form_ie" value="1" />
- <label for="txt_full_name" style="font-weight:bold;font-size:0.8em">
- Enter Full Name:
- </label>
- <br />
- <span id="val_txt_full_name">
- <input type="text" name="txt_full_name" size="25" />
- <span class="textfieldRequiredMsg">
- A value is required.
- </span>
- <span class="textfieldMinCharsMsg">
- Minimum number of characters not met.
- </span>
- </span>
- <br />
- <br />
- <input
- type="image"
- src="http://bytes.com/images/icon_050_submit_button.png"
- alt="Submit Form Details"
- id="submit_form_details"
- title="Submit The Information"
- onclick="return validate_try_simple_form_ie()"
- />
- <p class="clearIt" id="error_zone" style="visibility:hidden">
- ERRORS: There are some ERROR/S in the form, shown in red shading of the field/s. Please scroll up, correct them, and resubmit...
- </p>
- </form>
- <br />
- <br />
- <?php
- //see if the form details have been submitted
- if(array_key_exists('_try_simple_form_ie', $_POST))
- {
- print 'Name: '.$_POST['txt_full_name'].'<br />';
- };
- ?>
- <script type="text/javascript">
- var sprytextfield1 = new Spry.Widget.ValidationTextField("val_txt_full_name", "none", {validateOn:["blur", "change"], minChars:5});
- </script>
- </body>
- </html>