0

Guess this is javascript.

Similar as in excel, (I have seen this before), lets say I have 3 fields in a form.

Now when entering a numeric value in field 1, and lets say field 2 has the value of 5, then the value of field 1 times field 2 has to display in filed 3.

Please if anyone could assist me with this.

Also, similar to a popup calendar where one can select a date and once selected, the date automatically displays in the text field, how is it possible to have a custom popup page with pre-defined values, and ince a value in the popup are selected, its displayed in the field of the parent page.

4
Contributors
3
Replies
9
Views
9 Years
Discussion Span
Last Post by jubbar003
0
<html>

<body>

<form>
<input type="text" id="field1">
<input type="text" id="field2" ><br>
Answer 
<input type="text" id="ans" onfocus="document.getElementById('ans').value=document.getElementById('field1').value*document.getElementById('field2').value" >
</form>

</body>
</html>

When you Click on the 3rd field, it will display the answer i.e. the product of the first field and second field.
I hope this is what you wanted.
Have a nice day!! :)

0

this is very nice but the problem is that if you need to add up fields, let's say field1 + field2
when field1=3 and field2=4 the total is 34 instead of 3+4="7"

it works on multiplication, but not addition. such a simple script i wished it worked better

0

i need (field1field2/100)+field1
(100
5/100)+100
result= 105
but it is giving
5100

Edited by jubbar003: please provide me solution

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.