Test your Drupal Skills

Drupal Architecture Diagram

This is really useful those who wants to understand the schema and its flow. For better view, right click on the image and view the image the separately…
schemagraph-2007-10-18

Drupal Architecture Diagram

Drupal Architecture Diagram

Regular Expression to validate comma separated numbers using javascript

Today i got situation to validate text field containing comma separated numbers. I know how to validate numbers alone. But don’t know how to validate numbers with comma separated and each number should be 8 digits.

For example, 1234678,54872659,84567892,....

I searched google but didn’t find it and finally i got solution from my friend…

Here is the regular expression to do this trick,

/^(?:\s*\d{8}\s*(?:,|$))+$/

Usage:

<script language="javascript">
var pattern = /^(?:\s*\d{8}\s*(?:,|$))+$/;
var testvalue = document.getElementById('checkNumber').value;
if(pattern.test(testvalue)){
alert("Correct");
} else {
alert("Wrong");
}
</script>

 

More explanations on this regular expression, please check here

http://regex101.com/r/iY9bQ9

Hope this will be useful to you all.

Author: Vinodkumar Saravana.

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 22,000 views in 2012. If each view were a film, this blog would power 5 Film Festivals

Click here to see the complete report.

« Older entries Newer entries »