Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I have to calculate total marks and percentage of subjects of a students which are binded from Database by selecting Standard and Division.

I want java script function for onkeyup or onchange event of each subject texbox, so that the grand total should be displayed in txtGrandTotal and percentage shuold be displayed txtPercentage.

Please send me Java Script funcion for this.

Regards,
parshu (Programmer)
[snip]
Posted
Updated 20-Dec-10 10:35am
v4
Comments
Sandeep Mewara 20-Dec-10 1:48am    
No effort and demanding.
Smithers-Jones 21-Dec-10 3:25am    
You don't seem to understand what "programmer" means. A programmer is somebody who writes programmes, not somebody who asks in a programming forum for a programme or function. So you should go back, modify your question and remove the word "programmer" from your name.

hi,

<br />
function totalMark()<br />
{<br />
var total=$get('txtSub1').value+$get('txtSub2').value+...;<br />
var percentage=total/(totalmarks)*100;<br />
$get('txtGrandTotal').value=total;<br />
$get('txtPercentage').value=percentage;<br />
}<br />

I hope this may help you
 
Share this answer
 
This is not the way it works out here. Providing/writing codes are not encouraged until you make some effort and share across.

Further, I believe you are here for help and yet you sound just demanding. Is that so? You should understand that we are here to help and do this as we like it.

Now, about your issue:
I want java script function for onkeyup or onchange event of each subject texbox, so that the grand total should be displayed in txtGrandTotal and percentage shuold be displayed txtPercentage
Give it a try. All you need is to attach a onkeyup/onchange/onblurr event to the textboxes. Once you do it, they will get triggered everytime you make some change in them. In the Javascript method, trap the change, recalculate the total and percentage. Display it in the textbox/label intended to.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900