Archive for the ‘Javascript’ Category

Controlling Font Size With Javascript

The following script can be used to allow visitors to increase or decrease the size of text on your page. This can be useful for visitors who have trouble reading smaller text and allows them to increase it to something they can view more easily. This script will change the font size of any text [...]

Javascript Validation

Try testing the following form with valid and invalid email addresses. The code uses javascript to match the users input with a regular expression. Email: The code 1 2 3 4 5 6 7 8 9 10 function validate(form_id,email) {   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var address = document.forms[form_id].elements[email].value; if(reg.test(address) == false) {   alert(’Invalid [...]