|
|
#1 (permalink) |
|
Bronze Member
![]() Join Date: Feb 2007
Location: minnestota
Posts: 81
|
the script is set up for an onchange event but in order for it to work u need to leave the input field meaning its acting like it is an onblur event. y wont it change on the entery of new input? ne thoughts........???
<script language="JavaScript"> function calculate() { A1 = document.Qty_form.a1.value A2 = document.Qty_form.a2.value A3 = (A1*A2) document.Qty_form.a3.value = A3 } </script> <html> <body> <form name="Qty_form"> <input type="text" name="a1"> X <input type="text" name="a2" onChange=calculate();> = <input type="text" name="a3" > </form> <style type="text/css">
__________________
some times i sits n i thinks ............ some times i jus sits.
Last edited by jmad; 04-25-2007 at 11:01 PM. |
|
|
|
|
|
#3 (permalink) |
|
Bronze Member
![]() Join Date: Feb 2007
Location: minnestota
Posts: 81
|
is this what u meant i still have the problem with it seeming like it is on blur.
<html> <body> <script language="JavaScript"> function calculate() { A1 = document.Qty_form.quanity.value; A2 = document.Qty_form.price.value; A3 = (A1*A2); document.Qty_form.total.value = A3; } </script> <html> <body> <form name="Qty_form"> <input type="text" name="quanity"> X <input type="text" name="price" onChange=calculate();> = <input type="text" name="total" > </form> <style type="text/css"> </body> </html>
__________________
some times i sits n i thinks ............ some times i jus sits.
Last edited by jmad; 04-26-2007 at 02:29 PM. |
|
|
|
|
|
#4 (permalink) |
|
Super Noob
![]() |
something like that...
Code:
<html>
<body>
<script language="JavaScript">
function calculate()
{
var A1 = document.Qty_form.quanity.value;
var A2 = document.Qty_form.price.value;
var A3 = (A1*A2);
document.Qty_form.total.value = A3;
}
</script>
<html>
<body>
<form name="Qty_form" onChange=calculate();>
<input type="text" name="quanity">
X
<input type="text" name="price">
=
<input type="text" name="total" >
</form>
<style type="text/css">
</body>
</html>
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|