CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Calculate textbox value based on other two textboxes values for MULTIPLE ROWS

Print topic Send  topic

Author Message
sjgrodriguez

Posts: 26
Posted: 02/10/2012, 10:06 AM

Hi there. I have an editable grid with three textboxes called VALOR_PPM, DILUCION and RESULTADO

With Javascript, i want to calculate the value of the RESULTADO textbox based on the formulae: PPM * DILUCION .

My javascript code is:

<script language="javascript">
function fadd()
{
var uno,dos,resultado_final;
uno=parseFloat(document.Tasks.VALOR_PPM.value.replace(/,/gi, '.'));
//Take the value of second textbox and convert it to float
dos=parseFloat(document.Tasks.DILUCION.value.replace(/,/gi, '.'));
resultado_final=(uno*dos);
resultado_final = resultado_final.toString()
var myNewString = resultado_final.replace(".", ",");
//show the result in the result textbox
document.Tasks.RESULTADO.value=myNewString;
}
</script>

Also i have set the Onchange Event "fadd(this)" for the textboxes VALOR_PPM and DILUCION.

It works great when the editable grid has only one row. However, if it has two or more rows, it doesnt work. Actually, it does nothing.

How can i do to make this code work with multiple rows in an editable grid?

I have tried many things, with no success.

I hope that someone can help me.

Thanks in advance,

Sergio Gómez
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.