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

 add text boxes on the fly with java

Print topic Send  topic

Author Message
teke507

Posts: 69
Posted: 05/03/2007, 7:25 AM

i wrote this function to add text boxes then populate the text box called total.. but im having problems...thanks

<script language="JavaScript" type="text/javascript">
function AddBox() {

var PA = removalfull.d_jet.value;
var PB = removalfull.l_jet.value;
var PC = removalfull.large.value;
var MA = removalfull.15_mon.value;
var MB = removalfull.17_mon.value;
var MC = removalfull.19_mon.value;

removalfull.t_print.value= PA+PB+PC;
removalfull.t_mon.value= MA+MB+MC;

}

</script>
View profile  Send private message
fady005


Posts: 115
Posted: 05/03/2007, 9:05 AM

This is a java and not a javascript forum...
Plus I advice you to create the text box from the begining and then modify their visible property to true or false...
_________________
Be inventive !
View profile  Send private message
teke507

Posts: 69
Posted: 05/03/2007, 9:26 AM

i would like to mathimattically calculate the vlaues in a text box and put the total in another text box.....i under stand that it is not a java script forum soo when i do java script in code charge and have to use codecharge features to make it work where do i post!!!!
View profile  Send private message
matheus

Posts: 386
Posted: 05/03/2007, 9:45 AM

What fady005 told you, is that doesn't had nothing about Codecharge in your code, only Javascript.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
teke507

Posts: 69
Posted: 05/03/2007, 9:54 AM

sorry to disagree but in fact it does have to do with codecharge for example the code charge propertys can effect how you call items in java script and that could be part of my perticular problem .......all im trying to say is that CCS can affect everything and if peopel are familuar with using javascript with CCS maybe they can help....so all java questions are related to CCS " i doubt that also but lets agree on one thing and thats that Yessoftware should implement a javascript forum.....even though they dont create the code there are plenty of people that use it in conjunction with CCS using the CCSS event propertys and ids to write their code......


p.s. i should have elaborating on my original post and i am sorry for that....
View profile  Send private message
fady005


Posts: 115
Posted: 05/04/2007, 7:39 AM

I told you to create the text box with CCS and set they're visibility to true when you click on a button for example... You can still modify it's value with e.getControl.setValue... Tip: don't forget to change the value you get from other textbox to integer...
For a javascript forum, why not, try posting your idea in wishes forum...
_________________
Be inventive !
View profile  Send private message
teke507

Posts: 69
Posted: 05/04/2007, 8:47 AM

im not trying to physically add a text box but rathe wish to do a mathimatically calculatio of addition on a number of text boxs then display the value in an existing text box called totals sorry for the confussion... thanks all my text boxs already exist and are visible
View profile  Send private message
fady005


Posts: 115
Posted: 05/07/2007, 12:41 AM

Ok then everything is easy to do... For example, if you have two textbox named "tb1" and "tb2" and you want to put the result of it's addition in a textbox "tb3" and all the text boxes are in a grid named "main_grid" the code to put on the onclick event of the button which is in the same grid will be :
int val1 = Integer.parseInt(e.getGrid().getControl("tb1").getValue().toString());  
int val2 = Integer.parseInt(e.getGrid().getControl("tb2").getValue().toString());  
int sum = val1 + val2;  
e.getGrid().getControl("tb3").setValue(sum.toString());
If one of the textboxes or the button are in a different grid than the others listboxes, just add the name of your grid : e.getPage().getGrid("main_grid").get...

This should help you...
_________________
Be inventive !
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.