Welcome to WebmasterWorld Guest from 100.26.182.28

Forum Moderators: open

Message Too Old, No Replies

Javascript Help Needed on Maths Problem

     
12:00 pm on Sep 15, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 15, 2003
posts:98
votes: 0


Hello all, I am new to this forum although I have lurked for months, and have found much of the advice very helpful and generous. Now it is my turn to present a problem. How would I do the following in JavaScript:

On the site we present a report card on the company's performance such as: "Customer service is our priority" and then we have a textbox, asking users to enter a percentage score of how well we've done on this. So:

1) User A enters a number percentage (eg 33)
2) This number is added to other users' scores (eg 33 + 45 + 100)
3) An average percentage of all the users' scores is calculated (including the new user A's)
4) This average percentage is returned to user A

My JavaScript level is basic.

Hope you can help.

Cheers, Maynard.

12:04 pm on Sept 15, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


Welcome to the board Maynard,

>>This number is added to other users' scores (eg 33 + 45 + 100)

How are you keeping a tally of past percentages? Are you pulling these from a database or text file? This may be something you should do server-side and not with client side script.

12:22 pm on Sept 15, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 15, 2003
posts:98
votes: 0


Hello Korkus!

I guess I would have to keep the tally in a text file. Can this not be done in JavaScript then?

I have some knowledge of PERL. Can this be done in PERL, and if so, HOW?

Any advice would be much appreciated. Thanks so much.

Maynard.

12:25 pm on Sept 15, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


It sounds like you want to keep the data, and client-side javascript is not meant to do this. You could do it in perl, but a scripting language would be much easier. Do you have access to either PHP or ASP on your server?
2:29 pm on Sept 15, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 15, 2003
posts:98
votes: 0


Hi Korkus, we have PERL installed on our server and I understand the basics of this language, having scripted some search engines and worked with PERL and databases. Can you still help me if PERL is used or should I direct this question to another board? Very best, Maynard.

EDIT: I've just realised! I will repost in PERL/CGI forum!

2:33 pm on Sept 15, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


I was going to tell you that the Perl forum would be the best place to ask.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members