|
ulf-wendel.de   
|
|
 Home < PHP Schulung  < OOH Forms  < JavaScript  < JS_README    |       |  
Print Version    
---
|
|
 Home 
 PHP Projekte 
 PHP Schulung 
    Informationsquellen 
    Geschichte 
    Core PHP 
    Fortgeschrittenes PHP 
    Templates 
    Cache-Technologien 
    OOH Forms 
       Grundlagen 
       JavaScript 
          Aktivierung 
          Validierungstypen 
          JS-Codevariante I 
          JS-Codevariante II 
          JS_README 
          Custom Validators 
          Custom Validators II 
       XML 
       Layoutmanager 
       Pages 
       Wizards 
       Fazit 
 Technik der Site 
 Büchertipps 
 Fotografie 
 Airbrush 
 Kontakt 
 Stuff 

JS_README

Im Verzeichnis "HTML_OOH_Form/js/" befindet sich die Datei "JS_README", die einen ersten Einblick in die Details der JavaScript Programmierung gibt.

Unless you're a javascript guru or you like to write as short code as 
possible you should not read all this. It's on the javascript code
I use in the form class. Every time I haven't looked on it for 
a while I can't understand it myself anymore, that's why I've added an 
example with comments.

The basic idea behind the javascript code is to work in an object oriented
fashion. This keeps the code short for many form elements and allows
us to reuse the code in an elegant way when we have several forms on one page.

Simple validation code without custom validators:




Complex validation code featuring custom validators:


var _dojs = new form("dojs", ["name_text", ["l", 1, 4, "length_e", "r", "[a-z]", "i", "valid_e"], "lr"],
[],
["callback"]);