I was thinking that javascript 'eval( )' could be used with the generated
javascript names of fields recently put into place to provide client side
calculation.



ie:

<db:textField fieldName="total" calculation="price*quantity"/>

(the script then would be)

<script language="Javascript">
...
function calcTotal(form)
{
 form.total.value=eval(form.price.value*form.quantity.value);
//NOTE you need to get word total generated in here.
}
...
</script>


What do you think? I personally have some need for this kind of thing.

see:
http://javascript.internet.com/calculators/expression-solver.html
for a complete idea.  for the DbTextField.java tag, you would need to
generate the event handling and function
and remember to append to any onClick="" attributes delimited with a ';'
for example if you had

<db:textField fieldName="total" calculation="price*quantity"
onClick="domystuff()"/>

you would need to generate:

<input ... onclick="domyotherstuff();calcTotal(this)" >


Also, there is a calendar widget that I use for date fields that I'm
currently trying to get to work with the dbform fields. Before the problem
was that the @ sign was throwing it off in IE.
The new references might work...(still need to try and see)...



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to