Засіб перевірки JavaScript форми версія 2.5
оглянуто Artswork
I must apologize for the fact that I am no longer able to accept email questions about my script where I would afford many hours to helping people properly integrate this module and writing additional items for anyone. This has occurred since the email worms of August 2003 severely compromised my email address displayed here attacked to where I had to deal with thousands of erroneous returned emails a day. I may periodically try to turn it back on so please return or try again after the dust settles. I also must state how people with our skills can ruin and incredible idea such as the internet for communication is disparaging. I have tried for many years returning contributions to others for my success working upon this medium. Thanks to all the interest I have received.
Цей засіб перевірки форми можна перевірити наявність обов'язкові, ціле число, електронної пошти та датою поля у формах. Це легко стерпним до всіх форм і допоможе зберегти на сервері ресурси з перевірка поля форм і перезавантаження сторінки. Всі повідомлення налаштовані в приховані форми елемент, де також вибрано вимогу перевірки. Ви можете змішати обов'язкових елементів з будь-який з інших елементів. Цей код є повністю переносимі і може бути використаний з будь-якій формі, просто Додавання приховані елементи належним чином і додати на onClick команда для кнопки.

Слідуючи правилам.
1) Щоб настроїти обов'язкове поле використання існуючих ім'я поля та додати r_ на початку поля ім'я та створення прихованих елементів.
ПРИКЛАД:
<input type="text" name="your_fieldname">
<input type="hidden" name="r_your_fieldname" value="Required error message goes here">

2) Щоб встановити ціле поле використовувати існуючі ім'я поля та додати Цвета до початку поля ім'я та створення прихованих елементів.
ПРИКЛАД:
<input type="text" name="your_fieldname">
<input type="hidden" name="i_your_fieldname" value="Integer error message goes here">

3) To set a date field use your existing field name and add an d_ to the beginning of the field name and create a hidden element. This date field only accepts the format MM/DD/YY or M/D/YY.
ПРИКЛАД:
<input type="text" name="your_fieldname">
<input type="hidden" name="d_your_fieldname" value="Date error message goes here">

4) Для перевірки електронної пошти поле використовувати існуючі ім'я поля та додати до e_ до початку імені поля і створити прихованого елемент.
ПРИКЛАД:
<input type="text" name="your_fieldname">
<input type="hidden" name="e_your_fieldname" value="The email address format is incorrect">

Ініціалізація скрипта.
Ви повинні використовувати тип = не тип "кнопка" = "Надіслати" для вашої кнопки надіслати, javascript посилає надсилання для вас.
ПРИКЛАД:
<input type=button Value="Button Message Here" onclick="check(form,form.elements.length)">



Цей приклад використовує всі три перевірки інструментів у поєднанні.

Адреса електронної пошти: (required and email validation)
По-батькові: (required validation)
Прізвище: (required validation)
Адреса 1: (required validation)
Адреса 2: (no validation)
Скільки тобі років: (required and integer validation)
Років ви повинні були сценаріїв: (integer validation)
Що таке сьогоднішню дату: (mm/dd/yy) (date validation)
Виберіть тему: (required validation)
Виберіть перемикач: тест 1 тест 2 перевірити 3 (required validation)
Виберіть, щоб застосувати всі: тест 1 тест 2 перевірити 3 (required validation on box 1)

© 2004 Artswork