How to check form validation by javascript

Hello
Now, I am ready to show how to check form validation by using javascript. Its a primary stage of a javascript prorgammer. Lets go-

<!DOCTYPE html>
<html>
<head>
<title>Learn JavaScrtipt</title>

<script>
/*

var x = window.confirm(“Are you sure to delete this?”);

if(x){

window.alert(“Your data is goting to delete.”);

}else{

window.location = “https://tisuchi.wordpress.com&#8221;;
}

*/

/*
function emailchk(){
var x = document.aa.bb.value;

if(x.indexOf(“@”) == -1){
alert(“Please entair a valid email address”);
}
document.aa.bb.focus();
}
*/
function validation(){

if(document.formname.name.value==””)
{
alert (“Please enter User Name”)
document.formname.name.focus();
return false;
}
}
</script>
</head>

<body>

<form name=”formname” method=”POST” onsubmit=”return validation()”>
<input type=”text” name=”name” value=”” placeholder=”Type your name” ><br/>
<input type=”text” name=”email” value=”” placeholder=”Type your email” ><br/>
<input type=”submit” name=”email” value=”Submit Now”>
</form>
</body>
</html>

Save this file and run it. It will check if any field will be blank. Thanks for reading.

Advertisements

What is indexOf() in Javascript

Consider the previous tutorial for this tutorial.

If you enter an email address without the @, you’ll get an alert asking you to re-enter the data. Now question is, what is:x.indexOf(@)==-1? This is a method that JavaScript can search every character within a string and look for what we want. If it finds it will return the position of the char within the string. If it doesn’t, it will return -1. Therefore,x.indexOf("@")==-1 basically means: “if the string doesn’t include @, then:

 

Thanks for reading…

Check valid email address by Javascript

Hello Friends,
Hope you are fine. I am fine. Today, I am showing how to check valid email address by using javascript. Its a very primary label work for javascript programmer. This task for javascript beginner. Lets start the work.

<!DOCTYPE html>
<html>
<head>
<title>Learn JavaScrtipt</title>

<script>

function emailchk(){

var x = document.aa.bb.value;

if(x.indexOf(“@”) == -1){
alert(“Please entair a valid email address”);
}

}

</script>
</head>

<body>

<form name=”aa”>

<input type=”text” name=”bb” value=”” placeholder=”Type your email” onBlur=”emailchk()”>
<input type=”text” name=”cc” value=”” placeholder=”Type your phone” onClick=””>

</form>
</body>
</html>

This is the code for all the work. Now, save your fine and run this file. Well, now, your file is ready to use. Just blur your text field and you will see some interactive work by javascript.

Thanks for reading.

 

Show value of form element by Javascript

Hello Friends,
Now I am showing how to show value of form element by javascript. Its a very simple example for beganner. Lets start.

<form name=”aa”>

<input type=”text” size=”10″ value=”” name=”bb”><br> <input type=”button” value=”Click Here”onclick=”alert(document.aa.bb.value)”>

</form>

Here it is important that, we gave the names to the form and the element. So JavaScript can gain access to them.

Thanks for reading….

Best 20 JavaScript Frameworks

Hello Every One. I am interested to know about the very essential 20 Framework of Java Script.

———————————————- This Guide Lines is collected from other site —————-

The number of web applications being created and used has grown rapidly since the new millenium. And importantly, so has the sheer complexity of them — specially on the front end. No more static pages, no sir!

You have a ton of sections each interacting with each other and the server and yes, it’s as complicated as it sounds and just as hard to pull off. Today, I’d like to talk about a few, choice JavaScript frameworks that aim to simplify front end application development.


Why We Need Frameworks Like These

If you think jQuery is the answer, you lose a cookie and get an F grade!

Creating responsive, fluid, and maintainable interfaces for web apps isn’t as easy as one would imagine — there is data to be sent back to the server and the results parsed, data stores to be updated, views to be re-rendered and so much else that needs to be done in the background. Desktop developers have it much easier with robust tools and well defined workflows. Us, poor web devs? We’ve been twiddling DOM elements, creating models by hand and pulling our hair out trying to keep everything synched.

The monstrous rise in the number of web apps being built recently has really made it apparent that we need better tools and frameworks and the devs have responded with a staggering amount of solutions. Today, we’re going to go over just a few of these. A couple of these are quite old but I’m certain you can learn a lot from perusing their code base.

Sure, a few of these may be a little old but their code bases have lots of lessons to teach.


Sproutcore

Nettuts+ -- JavaScript Frameworks

Sproutcore powers a lot of high profile apps including MobileMe amongst others. Sproutcore has a steeper learning curve compared to the other options but makes up for it with developer productivity once he/she has learned the ropes.

This framework boasts a UI framework, the market standard MVC architecture and well written documentation.

Related links:

Continue reading