Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 0.66 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function validateForm() {
  2.     var x = this.["name"].value
  3.     if( x == null || x == "" ) {
  4.         alert("Не заполнено имя");
  5.         return false;
  6.     }
  7.     x = document.forms["contact_form"]["email"].value
  8.     if( x == null || x == "" ) {
  9.         alert("Не заполнен email");
  10.         return false;
  11.     }
  12.     if( !validateEmail() ) {
  13.         alert("Неверный формат email");
  14.         return false;
  15.     }
  16.     x = document.forms["contact_form"]["question"].value
  17.     if( x == null || x == "" ) {
  18.         alert("Не указан Ваш вопрос");
  19.         return false;
  20.     }
  21.     document.forms["contact_form"].submit()
  22. }