User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 423,520 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,378 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

I don't know how to start

Join Date: Nov 2004
Posts: 12
Reputation: beckerc is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
beckerc beckerc is offline Offline
Newbie Poster

Re: I don't know how to start

  #6  
Dec 20th, 2004
ok, I hope i am not too late. I did not check this over weekend.

here is a start. It has many bugs, but like i said, I want you to learn from this so you need to figure things out. I used to teach at college so I can't just give it to you.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  
<title>quick sample for someone</title>

<script language="JavaScript">
/***************************************************************
* Function: isValidFloat(num)								   
* Description: This function will check for a valid Float
****************************************************************/
function isValidFloat(num)
{	  
    var valid = "0123456789.";
	var temp;
	var decimalPointCount=0;
	
	for (var i = 0; i < num.length; i++)
	{
		temp = num.substring(i, i + 1);
		if(temp==".")
			decimalPointCount++;
		if (decimalPointCount > 1)
		{
			return false;
		}
		if (valid.indexOf(temp) == "-1")
		{		
			return false;
		}
	}
	return true;
}  



nTotalScores = 0;
nNumberOfScores =0;

function getScores(num){
nTotalScores = nTotalScores + num;
nNumberOfScores = nNumberOfScores + 1;

}




function getGrade( ) {
	var returnGrade = '';
	
	
	 
	if(  )
		alert("the grade is" + )
	else if(  )
		alert("The )
	else if(  ) 
		alert("")
	else if(  ) 
			alert("A Product Price 2 must have an Effective Date. Please select a second Effective Date.")
			
		    
	else returnGrade = 'f'
	return returnGrade 	
}	


/***************************************************************

* Function: trim(str)                                                                                               

* Description: This function will trim the spaces in a string

****************************************************************/

function trim(str) { 

            //Remove leading spaces...

            while (str.substring(0,1) == ' ') {

                        str = str.substring(1, str.length);

            }

 

            //Remove trailing spaces...

            while (str.substring(str.length-1, str.length) == ' ') {

                        str = str.substring(0, str.length-1);

            }

 

    return str;

}




</script>

<META name="GENERATOR" content="IBM WebSphere Studio">
</head>

 <body>
<form name ="someForm">
<table>
<TR ><TD> enter a score and click button </td><td><td><input type="text" name ="something"> <input type="submit"  onclick="javascript:getScores(document.someForm.something);" > </td></tr>
</table>
</form>
</body>
</html>
Reply With Quote  
All times are GMT -4. The time now is 5:03 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC