I have an input type="text" for names in my HTML code. I need to make sure that it is a string with letters from 'a' to 'z' and 'A' to 'Z' only, along with space(s).
This is my HTML code:
<form action="" name="f" onsubmit="return f1()">
Name : <input type="text" name="name">
I'm expecting my JavaScript to be something like this:
function f1()
{
var x=document.f.name.value;
.....
.....
return false;
}
PS: I'm not really familiar with Regular Expressions, so please do put up an explanation with the code.