[Javascript] Form Validation




In this video, I’ll show you how to validate a form with Javascript.

A Javascript validation isn’t secure, a server side (PHP) validation should be made too.

The code can be found here :

http://charnycoding.pastebin.com/4xekFznA

In this video, I’m using Dreamweaver Cs5 and Firefox.

Original source


37 responses to “[Javascript] Form Validation”

  1. does anybody know how to close a page in javascript. in dreamweaver cs5.5 I have a promopt that comes up and if the field is invalid i want it to close the page im on, ive used document.close nad window.close and it does not close the page im on

  2. regbefore=document.forms[0].elements[0].value.replace(/s+/gi,"")
    reg=new RegExp("jusTinbieber","gi").test(regbefore)
    if(reg==true && regbefore.length==12){window.alert("You are faggot"); }

  3. @TheJSBachMr Thanks for your comment. I got it all sorted actually… I did a full course on javascript programming that taught me everything i needed for form validation and a whole bunch more as well. tryimg to copy and paste other people's code just didn't work no matter what i did, or how many different versions I tried so i had to teach myself… which was a much better solution anyway. 🙂

Leave a Reply