easy sort table with javascript
javascript Август 20th, 2008
Скрипт сортировки данных в таблице с помощью JavaScript.
Tags: html, javascript, sort, sort table, table, tablesort
Скрипт сортировки данных в таблице с помощью JavaScript.
Tags: html, javascript, sort, sort table, table, tablesort
A while ago I put up a Password Strength Checker using JavaScript and Regular Expressions. On that same note, you can also check the structure of an email address utilizing the same methodology:
If your form element has the id=emailaddress and you add a form onSubmit=”return checkEmail();”, this is a Javascript function that you can utilize to return an alert if the email address has a valid structure or not:
function checkEmail() {
var email = document.getElementById(’emailaddress’);
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value)) {
alert(’Please provide a valid email address’);
email.focus
return false;
}else{
alert(’Email address is valid’);
email.focus
return true;
}
}
Try use this function:
Read the rest of this entry »
Actually that’s not true at all.
As all javascript objects are really just associative arrays, there is a foreach like syntax for the ‘for’ construct.
Without it it would be very hard to work with many common javascript objects.
It’s actually very simple to use and incredibly useful if you like associative arrays.
You just have to make sure to use it on an associative array and not an object.
Example below
Tags: foreach, how to, javascript, php