|
|
Dating - Getting "In" With The In-Laws
Getting Along with Your In-Laws
Getting along with your in-laws may be the toughest thing you
have to encounter when married or the easiest. Depending on your
personalities and relationship with your in-laws will determine
how easy it is to...
Dating Tips: You Can Get The Kind Of Women You Have Always Wanted
In this dating secrets article, I will teach you some tips and tricks to spice up the effectiveness of your first few dates with women and score better.
Guys who have lower self confidence when it comes to women like to think that they don't...
Homosexual Dating - Truth and Connection
Homosexual dating has become much more widespread and accepted in Western culture, allowing both gays and lesbians the chance to reach out to one another beyond that of closed doors. Now there are many ways you can have a rewarding homosexual...
The Rules of Dating, Vacationing and Compatibility
Romantic Getaway - Travel Survival Tips Vacations, distant destinations and a new amour conjure the unexpected. The insecurity of unfamiliar surroundings can surface irreconcilable differences amongst young love in bloom. In Corona beer...
The Top 10 Clues the Guy You're Dating is Married
Make
no mistake, married men who are fooling around can be
wonderfully attentive and romantic. He can be emailing you and calling you all
day long, filling your hungry heart with affirmations you never dreamed of,
showering you with gifts,...
|
|
|
|
|
|
|
|
Validating Form Input in JavaScript
This time we'll make a form that collects information about the visitor at your site. You must have filled-in copious registration forms or survey forms where you had to enter your name, your email, your address, etc. Sometimes users, intentionally or unintentionally, enter wrong information that can either spoil your database scheme or give you lots of useless data and hence, waste your precious server space.
To avoid such problems, as much as it can be managed, we programmatically try to make sure, that data is entered in an orderly fashion, and no unusable fields are entered. Checking individual fields of the form does this.
We'll see a form here with three fields: Name, Phone and Email. In this form, no field should be left blank, there should be no numbers in the Name field [1,2,3,4,.], and in the Email field, no email should be without the "@" sign. We can carry out more complex validations, but at the moment, these three should suffice.
/// Remove the extra dots while testing. They have been just inserted so that some email programs don't freak out at the presence of a JavaScript in the email.
<..script language="JavaScript1.2"> function CheckName(HoldName) { NoNumThere='true'; for(i=0; i { for(j=0; j<10; j++) { if(HoldName.charAt(i)==j.toString()) { NoNumThere='false'; break; } } if(NoNumThere=='false') { break; } } return NoNumThere; } function CheckMail(HoldMail) { IsValid='true'; if(HoldMail.indexOf("@")<=0) { IsValid='false'; } return IsValid; } function checkfields() { var AllFilled='true'; for(i=0; i<3; i++) { if(visitor.elements[i].value.length==0) { alert("The field [" + visitor.elements[i].name + "] can not be left blank."); AllFilled='false'; visitor.elements[i].focus; return; } } if(AllFilled=='true') { var NameValid=true; var EmailValid=true; NameValid=CheckName(visitor.vname.value); EmailValid=CheckMail(visitor.vemail.value); if(NameValid=='false') { alert("Sorry, your name can not contain numbers."); visitor.vname.focus; } if(EmailValid=='false') { alert("Sorry, this does not seem like a valid email address."); } } if(NameValid=='true' & EmailValid=='true') { alert("RIGHTO!!!"); } }
Copy and paste the code as it is, and save the entire content as a new HTML page. Then load it on to your browser. Unless you see the result, it'll be difficult to follow
the script if you do not have prior programming background. The first condition is, none of the fields can be submitted blank. Click on the submit button without entering anything and observe the reaction.
Here, we are making ample use of the recently learnt for(){.} loop. Then we have used function too, to carry out certain validations. Our main function, checkfields(), is associated with the OnClick attribute of the "Submit" button, that is, when you click on the "Submit" button, this function gets triggered.
Some new terms in today's script are: true, false, charAt(), toString(), break, indexOf(), string.length, and orm.elements[ ].
A quick explanation to make things easier:
If at 10:30 pm, I say, "It is night", then
var fact='true'
and if I say at 10:30 pm that "It's afternoon", then
var fact='false'
Which explains the use of true and false, which are also called Boolean operators, which means, a Boolean variable can either be true or false, but NEVER both.
Until we learn about arrays, every character in a string has an index position. For instance, if we have
var city="Delhi"
then city.charAt(0)="D", city.charAt(1)="e", city.charAt(2)="l"...city.charAt(4)="i".
toString(), converts another data type to a string data-type. For example,
var num1=31 var num2=21 var char1=num1.toString() var char2=num2.toString()
So,
num1+num2=52 and char1+char2=3221
In the second case, instead of being added, the variables are being concatenated, which indicates that they are strings, not numbers. We'll see its application later.
break, true to its name, breaks something. In this case, it breaks the loop in which it occurs, and takes the execution of the program to the line immediately after the loop, without meeting the condition required to complete the loop.
indexOf() tells us about the position of a particular character in a string. Look its use in the following code:
var city="Delhi"
Referring to this code, city.indexOf("e") should give us a value 1 and city.indexOf("h") should give us a value 3. city.indexOf("z") should give us a value less than zero, indicating that it does not belong to the given string.
String.length gives us the length of the string, for instance, if city="Delhi", then city.length would give us 5.
Again, elements[ ] is an array, and we haven't dealt with them yet, so we leave the rest of the explanation to the next section.
About the Author
Amrit Hallan is a freelance web designer. For all web site development and web promotion needs, you can get in touch with him at amrit@bytesworth.com or http://www.bytesworth.com. For more such articles, visit http://www.bytesworth.com/articles You can subscribe to his newsletter [BYTESWORTH REACHOUT] on Web Designing Tips & Tricks by sending a blank email at bytesworth-subscribe@topica.com
|
|
|
|
|
Welcome to dating.com |
The dating.com logo and brand are trademarks of Network Telephone Services Inc. All Rights Reserved ... dating.com is a member of the Relationship Exchange. ... |
www.dating.com |
  |
Free online dating service SearchYourLove |
Online dating service, which offers anonimity, security and yet real results! |
www.syl.com |
  |
Match.com - Find Singles at the World's Largest Online Dating ... |
Match.com personals brings singles together. As the proven leader in online dating personals services, Match.com provides millions of possibilities to meet ... |
www.match.com |
  |
Ok Cupid! Free Online Dating |
OkCupid's the #1 free online dating site. Specializing in personality analysis, it was programmed by Harvard math grads. |
www.okcupid.com |
  |
Dating & Relationships - expert advice, quizzes, and dating resources. |
The leading source for Dating & Relationship advice, online dating, dating quizzes, Q&A's, love and sex from Jeff Cohen, About's Dating Guide. |
dating.about.com |
  |
Online Dating Services - Singles, Personals and Dating Sites Directory |
TruDating.com offers a complete list of the best online dating sites. Find great online dating services, singles sites, internet personals, ... |
www.trudating.com |
  |
Dating - washingtonpost.com |
Get dating advice from experts like Carolyn Hax. Find date ideas and information on Washington DC dating. Learn about online dating and get relationship ... |
www.washingtonpost.com |
  |
Online Dating with Kindred Spirits Personal Ads - Home Page |
For personals, love and romance, find your Kindred Spirit using The Daily Telegraph’s online dating service. |
dating.telegraph.co.uk |
  |
Friends Reunited Dating |
Dating and picture personals for UK residents with postcode search facility. |
www.friendsreuniteddating.co.uk |
  |
Best Online Dating Singles Resource - Metrodate.com |
Metrodate.com is the Ultimate Singles Resource, featuring free photo and voice member profiles! |
www.metrodate.com |
  |
Best Online Dating Services Reviewed + Dating Tips & Advice |
Reviews of the best online dating services, plus dating tips and advice. See how American Singles, Match.com, LavaLife, Yahoo Personals, Date.com, ... |
www.edatingcentral.com |
  |
Plentyoffish.com Free Online Dating Service & Dating Site |
100% Free online dating and matchmaking service for singles. Stop wasting your money on other dating sites. |
www.plentyoffish.com |
  |
eHarmony #1 Trusted Relationship Site Move Beyond "Traditional ... |
eHarmony is the first service within the online dating industry to use a scientific ... If you have tried other online dating sites, graduate to eHarmony. ... |
www.eharmony.com |
  |
Online Dating with Encounters's Personal Ads - Home Page |
Encounters is the NEW and totally exclusive dating service for Times Online readers. Whether you're looking for new friends, a quick entrée into the world ... |
www.encounters.timesonline.co.uk |
  |
Newsday.com - Dating |
AmericanSingles.com connects gay and lesbian singles for dating and friendship using photo personals, e-mail, chat, IM and more. ... |
www.newsday.com |
  |
Scotsman.com Dating - find love in Scotland - Perfect Partners ... |
Scotsman.com Dating - Scottish dating and personal ads - find love in Scotland - perfect partners - men seeking women, women seeking men, men seeking men, ... |
dating.scotsman.com |
  |
Liv2luv Home |
Feedback | Search | Whoz Online | Dating Tips | Help. Indiatimes ID. Password. Remember Me ... Mobile Dating. -, Writing an Effective Personal Ad ... |
dating.indiatimes.com |
  |
Online Singles Dating Site - Meet Quality Singles Online |
Quality online singles dating site that will help you date and meet singles online. Read fun and in-depth reviews on singles sites, online dating services, ... |
www.quality-singles.com |
  |
Find Singles with the Top Online Dating Site -- Yahoo! Personals |
Try online dating with Yahoo! Personals. Search photo personal ads and meet other singles looking for fun dates and long-term relationships. |
personals.yahoo.com |
  |
DatingDirect.com Dating Direct |
Picture profiles and dating tips. Registration required to view personals. |
www.datingdirect.com |
  |
|