Reply
Getting value from function
Old 05-26-2006, 12:17 AM Getting value from function
Junior Talker

Posts: 2
for example this function get a value from a textbox and calculate and return the value to another textbox. this example can work.
-------------------------------------
<script type="text/javascript">
function chkBreakdown(){
myForm=document.brk
total=50*myForm.brkID.value
myForm.brk_total.value=total;
}
</script>
<html>
<body>
<form name="brk">
<input type="text" name="brkID" value="0" size="3" maxlength="3" onblur="chkBreakdown()">
<input type="text" name="brk_total">
</form>
</body>
</html>
------------------------------------------
now my problem is for example below:
Vector wp = new Vector();
Vector ln = new Vector();
<script type="text/javascript">
function chkBreakdown(wp,ln,la){
myForm=document.brk
total=wp+ln+la+*myForm.brkID<%=c%>.value <--is this correct or not?
myForm.brk_total.value=total;
}
</script>
<html>
<body>
<form name="brk">
<tr><td>LA no.</td><td>: <input type=text id="laNo" size=6 style="border:0" value='<%=la_no%>'> </td></tr>
<%for(int c=0; c<wp.size(); c++){%>
<td><input type="text" size=5 name="wp<%=c%>" value='<%=wp.elementAt(c)%>'></td>
<td><input type="text" size=4 name="ln<%=c%>" value='<%=ln.elementAt(c)%>'></td>
<td><input type="text" size=8 name="brkID<%=c%>" id="brkID" value='<%=brkID.elementAt(c)%>' onFocus="chkBreakdown('<%=wp.elementAt(c)%>','<%=l n.elementAt(c)%>','<%=la_no%>');"></td>
</form>
<input type="text" name="brk_total">
</body>
</html>
melvinoyh is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Reply     « Reply to Getting value from function
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.22828 seconds with 13 queries