Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Friday, 24 March 2017

How to Validate Email Id Using Javascript

In this article we see how to validate email id using regex in javascript.

HTML Code:-

form name="frmSample" method="post" action="#" onSubmit="return ValidateForm()">
<p>Enter an Email Address :
 <input type="text" name="txtEmail">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

Thursday, 16 February 2017

JavaScript: Displaying number in indian format

Here is the solution for displaying number in comma seprated format in your page using javascript.

JavaScript: Regular expression to validate URL


Please find below JavaScript code to validate URL using regex expression.

function ValidURL(url) {
 var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;        return regexp.test(url);
}

Javascript:Set cookie and get cookie


This post helps you to create , read and delete cookie in javacript.

Wednesday, 15 February 2017