JQuery :: Add A Score Counting To Script?
Mar 26, 2011
I am trying to add some sort of score system to my script, but I have no idea how to get this working. I have two files 1php and 1 javascript (which gets implemented in the php file)
What do I need?
I want to add a score system to my script.[code]...
But how to do this? Score starts with 0 ofcourse.
View 1 Replies
ADVERTISEMENT
May 18, 2010
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[code]...
View 9 Replies
View Related
Aug 11, 2006
I need help in calculating a score from a row of drop-down values.
I need to use the onChange to tally the score as the user moves across
9 categories (with drop-down selection of 1-9 or N/A) multiplied by a
weighted score. The final column for each employee would be the
calculated score. I know how to accomplish this with vbscript but I
need it to process on the screen so the user can see the calculated
score as they make selections. Also the code needs to execute as many
times as there are employee rows.(loop) I don't know how to do this
with Javascript
Here's the VBscript with the variables involved
Var S1 = Category 1 Weighted score
Var S2 = Category 2 Weighted score
Var S3 = Category 3 Weighted score
Var S4 = Category 4 Weighted score
Var S5 = Category 5 Weighted score
Var S6 = Category 6 Weighted score
Var S7 = Category 7 Weighted score
Var S8 = Category 8 Weighted score
Var S9 = Category 9 Weighted score
D5 = 0.92
Var Q11 = Category 1 drop-down Value(1-9) * S1
Var Q22 = Category 2 drop-down Value(1-9) * S2
Var Q33 = Category 3 drop-down Value(1-9) * S3
Var Q44 = Category 4 drop-down Value(1-9) * S4
If (Category 5 Value = "N/A") THEN
Q55 = ' '
Else
Var Q55 = Category 5 drop-down Value(1-9 or N/A) * S5
End If
Var Q66 = Category 6 drop-down Value(1-9) * S6
Var Q77 = Category 7 drop-down Value(1-9) * S7
Var Q88 = Category 8 drop-down Value(1-9) * S8
Var Q99 = Category 9 drop-down Value(1-9) * S9
If (Category 5 = "N/A") THEN
Var FinalScore = round(((Q11 + Q22 + Q33 + Q44 + Q66 + Q77 + Q88 + Q99)
/ D5),2)
else
Var FinalScore = round((Q11 + Q22 + Q33 + Q44 + Q55 + Q66 + Q77 + Q88 +
Q99),2)
end if
Can anyone help me converting this to javascript?
View 1 Replies
View Related
Sep 9, 2011
The page will display brief instructions followed by a table containing the quiz.The first is with the Score() function which reads as follows:
function Score(){
for(i=1;i<=10;i++)
if(ans[i]== yourAns[i])
[code]....
Now unless I'm mistaken (which I am since the score isn't being tabulated correctly) this function essentially uses a for to cycle through both arrays, comparing the user's input against the array containing the right answers. If the contents within index i are the same on both arrays the score increases by one point. Once it cycles through the arrays, it passes score over to prequiz.score.value which will later pass this number to the text box that will display the grade to the user.
Thinking it was the setAnsArray(question, answer) function I added a document.writeline to it. However it showed that the values were being passed correctly to the answer array. Added a document.writeline to the Score() function. Unlike the point above, score always displays as 00000 regardless of how many right answers I provide.
The second issue I'm having is that the reset button is not working correctly. If I hit reset and answer the first question, the score will come back as double the score displayed before.
<?xml version="1.0" encoding= "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
[code]....
View 10 Replies
View Related
Nov 14, 2009
I am trying to write a game in javascript that will play a tune when a certain score is reached. I can get music to play if i put the code behind a button but I would prefer to use an if statement in the header section.
View 2 Replies
View Related
Nov 7, 2011
I have a form, EWMS.php, that is a score sheet for a dart league. In this form I first have a user choose a division. Ajax returns that choice via MySQL database and PHP. Upon choosing a division that also fills in the next drop down choices of team, which again calls Ajax and brings in the teams associated with the division choice. All works good so far. The last call on team choice drop down brings in the players on that team in another drop down which is peppered throughout the form as it is based on these players that are chosen. The beginning form tag and ending form tag are located in the EWMS.php file while Ajax loads other input elements from the database into the middle of the form.
So now that the form works with these drop downs grabbing MySQL data, I am testing the data the user input by using action="process.php" method="post" in the form tag. In process.php I have some basic code:
$date=$_POST['date'];
$week=$_POST['week'];
$league=$_POST['league'];
//HOME TEAM
$teamH=$_POST['teamH'];
//VISITING TEAM
$teamV=$_POST['teamV']; .....
When a league is chosen it brings in this findleague.php :
<?php
$league=$_GET['league'];
//echo $league;
include("sparkplug2.php");
$result = mysql_query("SELECT DISTINCT(team) FROM member_data2011spring WHERE division = '$league' ORDER BY team ASC") or die(mysql_error());
$result2 = mysql_query("SELECT DISTINCT(team) FROM member_data2011spring WHERE division = '$league' ORDER BY team ASC") or die(mysql_error());
?> .....
View 9 Replies
View Related
May 13, 2009
I have a multiple choice quiz in HTML. My requirement for scoring this quiz seems to be different from every other quiz I have seen on the net.
This is due mainly, I believe, to the fact that the number of questions involved in this quiz can be from 1 to infinite as the user action brings up the next question from external JS Q&A files.
In addition I want the user to see their score amended each time they answer a question, not at the end of the quiz (which theoretically may never happen).
In the existing code I already determine and provide "Correct" and "Incorrect" messages immediately following the selection of any of the four 'answer' radio buttons.
What I need to do now is to find out how I can arrange to:
1 count all the Correct answers - when they occur and add to a 'running' total (RT1)
2 count all the Incorrect answers - when they occur and add to a 'running' total (RT2)
3 calculate:- (RT1/(RT1 + RT2)) x (100/1) = percentage success rate so far.
The percentage success rate so far� is to be shown in a text field for the user to see.
View 7 Replies
View Related
Apr 2, 2010
I've been fiddling with the .length function but can't get it to return anything other than the number of <img> in the document.
View 3 Replies
View Related
Feb 22, 2011
Is it possible for jQuery to count the number of rows in a table and then add some more if there is less than a defined amount? So that this table with less than 10 rows.....
<table class="testTable">
<tr>
<td>Foo...</td><td>Foo...</td><td>Foo...</td>
</tr>
</table>
Becomes this...
<table class="testTable">
<tr><td>Foo...</td><td>Foo...</td><td>Foo...</td>
</tr><!--added by jQuery -->
<tr><td>...bar</td><td>...bar</td><td>...bar</td>
</tr><tr>
<td>...bar</td><td>...bar</td><td>...bar</td> .....
View 3 Replies
View Related
Jul 12, 2010
I am a newbie to jquery i want to count some tags inside a <iframe>.The iframe src is like this<iframe src="http://mysite.com/testing.php?id=7632762"></iframe>the php file included in the source contains several include files and more php kinda script finally a html output is generated.How to count the tags this generated html
View 18 Replies
View Related
Dec 10, 2010
I need to count the non - empty fields on a JQuery tab. The following works to tally non-empty text fields and selects. How do I do the same for non-empty textareas?
[Code]...
View 1 Replies
View Related
Aug 24, 2009
I'm trying to access an XML file, but it doesn't seem to work, this is an example of the XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<pics>
<pic>
<autor>rtteewt</autor>
<desc>trhtrhtreherhetrhhrh</desc>
[Code]...
View 1 Replies
View Related
May 6, 2011
I have a need to count how many time the image ok.png is displayed within a div. this is for a dynamic sys req. check where 1 of three images will be shown in a row. If the endusers browser doesnt meet certain req, it will show either an alert, question or an ok.png.I need to know how many oks there are, specifically I need to check that all five images are the ok.png so I can show the rest of the content.I am able to get the number of images with a simple var totalgreen = $("#wrap img").length; But im stuck after that.
View 2 Replies
View Related
Nov 22, 2011
I am trying to count the characters in a text area in a form for sending sms from web to phone. Bulk sms standard is: maximum sms pages are 7 i.e 1071 characters; page 1 contains 160 characters, page 2 contains 146 characters and the rest 5 pages contains 153 characters.
Here is a javascript function I wrote but it's not working
function countPage(){
var clPg1 = 160; //character limit for page 1
var clPg2 = 146; //character limit for page 2
var clOtherPg = 153; //character limit for other pages
[Code].....
View 1 Replies
View Related
Sep 9, 2011
I have this working code:
$(document).ready(function() {
As you can see its numbers counting up to 31 in both IDs (its a calendar). Any way to put this in less lines?
View 3 Replies
View Related
Apr 8, 2006
i want to make a section using javascript that may incoporate user input counters. for now i'm trying to make it so that if you type in a phrase or sentence in a textbox and a letter in another textbox, it will count how many letters are in the phrase. the point of this is i want to be able to categorize famous phrases by the number of specific letters they contain.
View 3 Replies
View Related
Mar 16, 2006
Is there a way to count files in a specific folder using ONLY
javascript?
I am creating a site for the intranet at work that will post weekly
reports. Users will drop weekly reports in a folder and I would,
hopefully, like to post whatever files are in that folder without
manually creating links to each file..
View 2 Replies
View Related
Sep 19, 2009
I have an array holding 100 randomly generated integers between 0-9 inclusive...firstArray[99]
how do i use a second array to keep count of how many times each integer is generated..secondArray[9]
View 2 Replies
View Related
Nov 22, 2006
Is it possible to count how many layers have been loaded as they are loading?
What I want to make is a layer containing the text "x of 15 layers loaded" and for x to increase everytime a layer is loaded on the page. (using onload?)
View 2 Replies
View Related
Sep 18, 2006
Does anyone know a simple way to count how many times a file is downloaded from my site - just Word Docs, Excel Docs etc. I say simple because I'm a Javascript toddler.
View 2 Replies
View Related
Dec 28, 2011
I can do this using Java, Vb.Net or C# .. Now, I am currently studying javascript but I don't know how to do this... I want a looping number, the number will start at 200 and it must end at 900, the loop format is like a.. from 200 it must increment but 1 every second and stop when it reach the 900, the counter must start when the page is loading or after loading.
View 2 Replies
View Related
Oct 7, 2005
This involves the use of an order form used to process a purchase via Paypal. The items are small rhinestone letters for names and such.
The form is very simple in that the purchaser enters into form field one: the letters they wish to purchase.
Form field two (this is where I rely on common sense by the purchaser): enter the number of letters entered in form field one.
Based on the number of letters entered in form field two, my form processes the correct cost for the purchase.
As you have already figured out, I am beginning to see people enter their letter orders w/out entering the number of letters ordered.
All that said: a way to count the letters entered in form field one and auto-populate form field two with that number. Code:
View 2 Replies
View Related
Sep 21, 2006
I want to count the number of childnodes, when i run this script in mozilla i get a different total for the number of childnodes from numkids then when the script runs in IE. Why is this? How Can I get the same number. I want to loop though an objects child elements setting them to invisible or visible
<script type="text/javascript"><!--
function rec(n) {
var kids = n.childNodes;
var numkids = kids.length;
for(var i = numkids-1; i>=0; i--)
{
// sets child to hidden
alert(numkids);
alert(kids[i].nodeValue);
//kids[i].style.visibility = 'hidden'
}}
var a = document.getElementById('commentholder0');
// this function loops though the parts and makes then invisiable so you cant see them overlap
rec(a);
</script>
My html is here:
<ul id= "commentholder0" >
<li id="comment1">this is a test</li>
<li id="comment2">this 2 is a test</li>
</ul>
View 2 Replies
View Related
Oct 28, 2009
I feel stupid for asking a question about searching arrays, when there's a very similar thread that has been answered just recently on the first page; however, I'm still having trouble contemplating my own scenario.Basically, my program prompts the user for the length of the array and then asks the user to fill the array with words.I want to confirm if the user wants to search the array for those words. If so, the user will then be prompted to enter the word he wishes to search for; if found, the location of that word will be reported and the number of times the word has been searched for will be kept track of in a separate array.Here is what I have so far:
/* -- phase 3 ------------------------------------------------------
search for words the user asks for
*/
[code]....
View 12 Replies
View Related
Nov 11, 2009
Is there any option not to use an array in counting the checks on checkboxes? Code will be integrated into an ORACLE database. I'm trying to catch up same output as stated below;but whenever i integrate it to Oracle database it doesnt work. I am a beginner in PHP programming.
<html>
<head>
<script type="text/javascript">
function countCheckboxes ( ) {
var form = document.getElementById('testForm');
var count = 0;
[Code]...
View 1 Replies
View Related
Nov 16, 2005
I have been trying to think up a way to count the number of clicks a partner/affiliate link on my website recieves. Many websites use some tracking script but the partner/affiliate wont benefit from your PR and the link would be for traffic only. It bugs me when I request a link exchange and instead of getting the straight link that I give the other person, I get a link to a script that tracks the clicks. So with the help of AJAX, I was thinking of doing something like:
Code:
<a href="http://www.domain.com" onClick="trackClick(this)">Link text</a>
Where trackClick() is an AJAX function that sends the client information (IP, timestamp, link clicked, etc) to a PHP script which then stores it in a database. Seeing as search engine bots have JavaScript disabled, they would see the code as a straight link to another site and give the target website credit for the link.. while the webmaster can keep track of the number of clicks their links recieve.
My question is.. would this work? And has anyone tried implementing something like this before?
View 10 Replies
View Related