View Full Version : Need some help...i think it will be elementry..but it beats me.

03-19-2005, 11:39 AM

me is php coder. Java a bit above me head.

Here is what I want..

I want to be able to total up column of textboxs. The columns can have n number of rows (depending on a previous query).

And if the total is less than a particular number then the submit button should apaer otherwise the submit button should remain invisible.

an eg:

Textbox that needs to be totaled ..there can be any number of rows each row iwll have just one text box that needs entering. default value=0

For ($i=1;$i<something;$i++){
<input type="textbox" size="5" name="AMT$i" size="12">

Totaling Box:

<input id="TOTAL" name="TOTAL" size="12" readonly>

The value in the totaling box should not exceed the value in this other table cell defined by XX.XX or Balance.

<TD valign="top" align="left" width="0%" BGCOLOR="#FFFFFF" class="formdatafield">XX.XX<input type="hidden" value="XX.XX" name="balance">

If the totaled value does exceed the "BALANCE" value then the submit button should not appear.

Hope you guys can help me. I tried rehashing a code (just adding up the columns) and well failed rather spectacularly. Hence the posting.

Apurva M

03-19-2005, 12:08 PM
got a bit confuses with you requirement but this may help



<script language="JavaScript" type="text/javascript">
add=new Array();

function Add(){
add[add.length-1].value='New Text Box '+add.length;
if (document.getElementsByTagName('INPUT').length>document.getElementById('hidden').value){





max text boxes normally hidden <input id="hidden" value="10"><br>
number of text boxes <input id="fred" value="A text box"><br>
Text Box Total <input id="fred" value="A text box"><br>
<input id="AddBut" type="button" name="" value="Add Text Box" onclick="javascript:Add();" ><br>


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum