Your help would be appreciated.
1) How to line up (right justify) these numbers?
2) If "13.5" is the value, I want to display "13.50".
I wrote some JavaScript functions to parse the input objects as strings and then pad with zeors. Is there a better way to handle it?
3) I usually have problems displaying the "result of calculations" in proper format (9,999.90). I put the formulas in some JS functions, and use onFocus/onBlur to activate them. Is there a better way?
total_cost = unit_price * qty
open_qty = qty - rec_qty + ret_qty
Thanks.
Dove85
-----------------------------------------
<HTML>
<BODY>
<FORM NAME="OrderedItemsForm" METHOD="post" ACTION="SUBMITxyz.jsp">
<TABLE>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT> </TD><TD> </TD>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=RIGHT VALIGN=BOTTOM>Unit Price</TD>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=RIGHT VALIGN=BOTTOM>Total</TD>
</TR>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Ordered Qty. :</TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="qty" SIZE="20"></TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="unit_price" SIZE="20"></TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="total_cost" SIZE="20"></TD>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Received Qty.:</TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="rec_qty" SIZE="20"></TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="unit_price_rec" SIZE="20"></TD>
<TD><INPUT readOnly CLASS=INPUTCELL TYPE="text" NAME="total_cost_rec" SIZE="20"></TD>
</TR>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Returned Qty:</TD><TD ALIGN=RIGHT><INPUT CLASS=INPUTCELL TYPE="text" NAME="ret_qty" SIZE="20"></TD></TR>
</TR>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Open Quanty:</TD><TD ALIGN=RIGHT><INPUT readOnly CLASS=INPUTCELL TYPE="text" NAME="open_qty" SIZE="20"></TD>
</TR>
</TABLE>
</TD>
</TABLE>
</BODY>
</HTML>
1) How to line up (right justify) these numbers?
2) If "13.5" is the value, I want to display "13.50".
I wrote some JavaScript functions to parse the input objects as strings and then pad with zeors. Is there a better way to handle it?
3) I usually have problems displaying the "result of calculations" in proper format (9,999.90). I put the formulas in some JS functions, and use onFocus/onBlur to activate them. Is there a better way?
total_cost = unit_price * qty
open_qty = qty - rec_qty + ret_qty
Thanks.
Dove85
-----------------------------------------
<HTML>
<BODY>
<FORM NAME="OrderedItemsForm" METHOD="post" ACTION="SUBMITxyz.jsp">
<TABLE>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT> </TD><TD> </TD>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=RIGHT VALIGN=BOTTOM>Unit Price</TD>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=RIGHT VALIGN=BOTTOM>Total</TD>
</TR>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Ordered Qty. :</TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="qty" SIZE="20"></TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="unit_price" SIZE="20"></TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="total_cost" SIZE="20"></TD>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Received Qty.:</TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="rec_qty" SIZE="20"></TD>
<TD><INPUT CLASS=INPUTCELL TYPE="text" NAME="unit_price_rec" SIZE="20"></TD>
<TD><INPUT readOnly CLASS=INPUTCELL TYPE="text" NAME="total_cost_rec" SIZE="20"></TD>
</TR>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Returned Qty:</TD><TD ALIGN=RIGHT><INPUT CLASS=INPUTCELL TYPE="text" NAME="ret_qty" SIZE="20"></TD></TR>
</TR>
<TR>
<TD CLASS=TEXTAREACELLGRAYSHADED ALIGN=LEFT>Open Quanty:</TD><TD ALIGN=RIGHT><INPUT readOnly CLASS=INPUTCELL TYPE="text" NAME="open_qty" SIZE="20"></TD>
</TR>
</TABLE>
</TD>
</TABLE>
</BODY>
</HTML>