JavaScript love calculator

Posted by midhun pottmmal On Friday, 18 January 2013 6 comments

JavaScript love calculator


Hello friends now we presenting a simple java script love calculater .Its the first tutorial that having live demo on our blog . its simple funny and use some mathematics functions ,so it will help to understand how works java script functions and button click listeners..

Live demo                                    

Love Tester

-->
+ =
Scriptime.blogspot.in


Source

function calc() {

first = document.loveform.name1.value.toUpperCase();
firstlength = document.loveform.name1.value.length;
second = document.loveform.name2.value.toUpperCase();
secondlength = document.loveform.name2.value.length;
var LoveCount=0;

for (Count=0; Count < firstlength; Count++) {
letter1=first.substring(Count,Count+1);
if (letter1=='L') LoveCount+=2; 
if (letter1=='O') LoveCount+=2; 
if (letter1=='V') LoveCount+=2; 
if (letter1=='E') LoveCount+=2; 
if (letter1=='Y') LoveCount+=3; 
if (letter1=='O') LoveCount+=1; 
if (letter1=='U') LoveCount+=3;
}

for (Count=0; Count < secondlength; Count++) {
letter2=second.substring(Count,Count+1);
if (letter2=='L') LoveCount+=2;
if (letter2=='O') LoveCount+=2; 
if (letter2=='V') LoveCount+=2; 
if (letter2=='E') LoveCount+=2;
if (letter2=='Y') LoveCount+=3;
if (letter2=='O') LoveCount+=1;
if (letter2=='U') LoveCount+=3; 
}

amount=0;
if (LoveCount> 0) amount=  5-((firstlength+secondlength)/2)
if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2)
if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2)
if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2)
if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2)
if (LoveCount>10) amount= 50-((firstlength+secondlength)/2)
if (LoveCount>12) amount= 60-((firstlength+secondlength)/2)
if (LoveCount>14) amount= 70-((firstlength+secondlength)/2)
if (LoveCount>16) amount= 80-((firstlength+secondlength)/2)
if (LoveCount>18) amount= 90-((firstlength+secondlength)/2)
if (LoveCount>20) amount=100-((firstlength+secondlength)/2)
if (LoveCount>22) amount=110-((firstlength+secondlength)/2)

if (firstlength==0 || secondlength==0) amount= "Err";
if (amount < 0) amount= 0;
if (amount >99) amount=99;

document.loveform.output.value=amount+"%";
}

Download Source

                              

6 comments:

Saim Kumar said...

very helpful site.. bro

Philemon Mulwahali said...

I've seen how it goes

sunil pareek said...

Thanks for sharing a nice article such a wonderful site you have done a great job once more thanks a lot

Love calculator

Love test

Love meter

True love calculator

Real love calculator

Love compatibility test

Love calculator game

Love test games

Love percentage

Love calculator online

Love meter test

True love test

Love calculator by name

Love test calculator

Love compatibility calculator

Name matching calculator

Real love test

Name love match

Love match

Love detector

Team Event said...

This is really a great article and great read for me. Its my first visit to your blog and i have found it so useful and informative specially this article.
easter sunday message
funny easter captions
christian easter poems
easter bible study
easter poems religious
easter thoughts
funny easter poems
happy easter religious messages
easter vigil
easter phrases
easter kjv
easter poems for children's church
famous easter poems
easter poems for preschoolers
easter scriptures he is risen
happy easter messages

Sunil Pareek said...

Thanks for sharing a nice article such a wonderful site you have done a great job once more thanks a lot

Amazing!!! I like this website so much it's awesome.I have also gone through your other posts too, and they are also very much appreciate able, and I'm just waiting for your next update to come as I like all your posts... well I have also made an article hope you go through it.
Happy Mothers Day Pictures
Mothers Day Wallpapers
Happy Mothers Day Wallpapers

Sunil Pareek said...

Amazing!!! I like this website so much it's awesome.I have also gone through your other posts too, and they are also very much appreciate able, and I'm just waiting for your next update to come as I like all your posts... well I have also made an article hope you go through it.

This is great, unique and very informative post; I like it. thanks
july 4th 2018
happy 4 july
4 july usa

Post a Comment

Fashion