background preloader

Javascript

Facebook Twitter

Css

Data. Youngpup.net - TransMenus. Categories of pattern matching characters. Categories of Pattern Matching Characters Pattern-matching characters can be grouped into various categories, which will be explained in detail later.

Categories of pattern matching characters

By understanding these characters, you understand the language needed to create a regular expression pattern. The categories are: Position matching- You wish to match a substring that occurs at a specific location within the larger string. For example, a substring that occurs at the very beginning or end of string. The following are categorized tables explaining the above: Position Matching Literals The backslash (\) is also used when you wish to match a special character literally. Character Classes Repetition Alternation & Grouping Backreferences Pattern Switches In addition to the pattern-matching characters, you can use switches to make the match global or case- insensitive or both: Switches are added to the very end of a regular expression.

Javascript form validation - doing it right. Web Matters When using Javascript for form validation, there is a right way, a wrong way, a very wrong way, and a suicidally wrong way!

Javascript form validation - doing it right

Unfortunately many sites use one of the wrong ways, including even some which claim to be form-validation tutorials. This page tries to help people in the right direction. The suicidally wrong way is to have the validation in Javascript only, and not on the server. A malicious user can easily bypass it and – depending on what you are doing – may wreak havoc with your database. The essence is thus that Javascript validation is always optional. Having said that, there are actually two right ways, of which the better one is hardly ever used!

Acceptable: validate the entered data when the submit button is pressed. Example Here is an example of how Javascript validation should work. It doesn't actually have any server script, so anything you type will be discarded on submission. <P> Javascript is not currently enabled on your browser. How it works Conclusion. Mathieu &#039;p01&#039; Henri. Add Interactive Features to Your Site. Datetime Toolbocks - Intuitive Date Input Selection. Davidflanagan.com: July 2005 Archives. JavaScript Triggers. The front end of a website consists of three layers.

JavaScript Triggers

XHTML forms the structural layer, which contains structural, semantic markup and the content of the site. To this layer you can add a presentation layer (CSS) and a behavior layer (JavaScript) to make your website more beautiful and user-friendly. These three layers should remain strictly separate. For instance, it should be possible to rewrite the entire presentation layer without touching either the structural or the behavior layer. Despite this strict separation, the presentation and behavior layers need instructions from the structural layer. CSS triggers are well known. JavaScript triggers#section1 The behavior layer should function in exactly the same way. The simplest JavaScript trigger is the id attribute: <div id="navigation"><ul><li><a href="#">Link 1</a></li><li><a href="#">Link 2</a></li><li><a href="#">Link 3</a></li></ul></div> var x = document.getElementById('navigation'); if (!

Advanced triggers#section2.