Log In · Register

 
Form math help?!
Maccabee
post Dec 1 2008, 09:27 PM
Post #1


Senior Member
*******

Group: Official Designer
Posts: 5,880
Joined: Nov 2007
Member No: 593,382



Ok here is the code.

<FORM>

F:<INPUT type="text" name="F" value="32"
onChange="C.value = 100/(212-32) * (this.value - 32 )"></td>

C:<INPUT type="text" name="C" value="0"
onChange="F.value = (212-32)/100 * this.value + 32 "></td>

<td colspan="2"><INPUT type="button" value="Click for Answer"></td>

</form>

And here it is in action.

wefuze.com/tools/temp-converter

Now if you understand java and stuff youll see how this works.

Now how can I adjust this code for other uses such as determining how many feet there are in how many yards?!
 
 
Start new topic
Replies
newkidontheblock
post Dec 2 2008, 10:50 PM
Post #2


Offline.
*****

Group: Official Designer
Posts: 609
Joined: Mar 2007
Member No: 507,591



All you have to do is change the onChange Event:
CODE
onChange="yard.value = (this.value / 3 )"
- >
CODE
onChange="feet.value = this.value * 3"


Here is the complete code:

CODE
<table cellpadding="5" cellspacing="0" border="0" >
<form>
<tr>
<td> Feet </td>
<td> <input type="text" name="feet" value="3" onChange="yard.value = (this.value / 3 )" /> </td>
</tr>
<tr>
<td> Yard: </td>
<td> <input type="text" name="yard" value="1" onChange="feet.value = this.value * 3" /> </td>
</tr>
<tr colspan="2" >
<td colspan="2"> <input type="button" value="Click for Answer" /> </td>
</tr>
</form>
</table>

Tested In: Internet Explorer 6 +, FireFox, Opera
 

Posts in this topic
JosephCohen123   Form math help?!   Dec 1 2008, 09:27 PM
Fawaz   All you have to do is change the onChange Event: C...   Dec 2 2008, 10:50 PM
JosephCohen123   QUOTE(Fawaz @ Dec 2 2008, 09:50 PM) All y...   Dec 3 2008, 11:01 AM
Fawaz   no prob.. any help just pm me.   Dec 3 2008, 04:02 PM
schizo   Closed and moved to resolved.   Dec 4 2008, 04:54 PM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: