deekay
03-21-2012, 11:10 PM
Hello all. I'm so glad i found this forum!!! This looks like a great coding community. This will be my First Post. :thumbsup:
I was wondering if you guys can help me with my weight converter. I cant seem to make it work properly on my site.
here is the code im using:
<p class="about">Convert weight measurements between U.S./Imperial and SI (Metric) units<br /> Type your value in a box, click the <input onclick="alert('Not this button!')" type="button" name="test_bt" value="Go!" /> and all unit conversions in the same category will be calculated.</p>
<form action="">
<table width="500" border="1" cellspacing="0" cellpadding="4">
<tbody>
<tr bgcolor="#0066ff"><th class="headings" colspan="3" bgcolor="#1765BB">SI (Metric)</th></tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Tonne</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mTon" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mTon.value)) compute(this.form,mTon.name,weight_data)" type="button" name="mTon_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Kilogram (kg)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mKilogram" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mKilogram.value)) compute(this.form,mKilogram.name,weight_data)" type="button" name="mKilogram_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Gram (g)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mGram" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mGram.value)) compute(this.form,mGram.name,weight_data)" type="button" name="mGram_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Milligram (mg)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mMilligram" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mMilligram.value)) compute(this.form,mMilligram.name,weight_data)" type="button" name="mMilligram_bt" value="Go!" /></td>
</tr>
<tr><th class="headings" colspan="3" bgcolor="#103e78"> </th></tr>
<tr bgcolor="#0066ff"><th class="headings" colspan="3" bgcolor="#1765BB">Troy weight</th></tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Pound (lb t)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyPound" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyPound.value)) compute(this.form,troyPound.name,weight_data)" type="button" name="troyPound_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Ounce (oz t)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyOunce" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyOunce.value)) compute(this.form,troyOunce.name,weight_data)" type="button" name="troyOunce_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">PennyWeight (dwt)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyDWT" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyDWT.value)) compute(this.form,troyDWT.name,weight_data)" type="button" name="troyDWT_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Grain<br /> Same as Avoirdupois grain</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyGrain" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyGrain.value)) compute(this.form,troyGrain.name,weight_data)" type="button" name="troyGrain_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#6699ff">
<td class="headings" colspan="3" bgcolor="#103e78"> </td>
</tr>
<tr bgcolor="#0066ff"><th class="headings" colspan="3" bgcolor="#1765BB">Avoirdupois weight</th></tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">British ("long") ton</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="briTon" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(briTon.value)) compute(this.form,briTon.name,weight_data)" type="button" name="briTon_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">US ("short") ton</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="usTon" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(usTon.value)) compute(this.form,usTon.name,weight_data)" type="button" name="usTon_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" height="42">British ("long") hundredweight (cwt)</td>
<td class="headings" align="right" bgcolor="#103e78" height="42"><input type="text" name="briCWT" size="15" /></td>
<td class="headings" bgcolor="#103e78" height="42"><input onclick="if (checkNum(briCWT.value)) compute(this.form,briCWT.name,weight_data)" type="button" name="briCWT_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">US ("short") hundredweight (cwt)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="usCWT" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(usCWT.value)) compute(this.form,usCWT.name,weight_data)" type="button" name="usCWT_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Stone</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="briStone" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(briStone.value)) compute(this.form,briStone.name,weight_data)" type="button" name="briStone_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Pound (lb)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpPound" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpPound.value)) compute(this.form,avdpPound.name,weight_data)" type="button" name="avdpPound_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Ounce (oz)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpOunce" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpOunce.value)) compute(this.form,avdpOunce.name,weight_data)" type="button" name="avdpOunce_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Dram (dr)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpDram" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpDram.value)) compute(this.form,avdpDram.name,weight_data)" type="button" name="avdpDram_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Grain</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpGrain" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpGrain.value)) compute(this.form,avdpGrain.name,weight_data)" type="button" name="avdpGrain_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" colspan="2" align="center" bgcolor="#103e78"><input onclick="resetAll(this.form)" type="button" name="res7" value="Clear all numbers" /></td>
<td class="headings" bgcolor="#103e78"> </td>
</tr>
</tbody>
</table>
<p> </p>
</form>
<p> </p>
and help will be greatly appreciated.
I was wondering if you guys can help me with my weight converter. I cant seem to make it work properly on my site.
here is the code im using:
<p class="about">Convert weight measurements between U.S./Imperial and SI (Metric) units<br /> Type your value in a box, click the <input onclick="alert('Not this button!')" type="button" name="test_bt" value="Go!" /> and all unit conversions in the same category will be calculated.</p>
<form action="">
<table width="500" border="1" cellspacing="0" cellpadding="4">
<tbody>
<tr bgcolor="#0066ff"><th class="headings" colspan="3" bgcolor="#1765BB">SI (Metric)</th></tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Tonne</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mTon" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mTon.value)) compute(this.form,mTon.name,weight_data)" type="button" name="mTon_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Kilogram (kg)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mKilogram" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mKilogram.value)) compute(this.form,mKilogram.name,weight_data)" type="button" name="mKilogram_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Gram (g)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mGram" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mGram.value)) compute(this.form,mGram.name,weight_data)" type="button" name="mGram_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Milligram (mg)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="mMilligram" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(mMilligram.value)) compute(this.form,mMilligram.name,weight_data)" type="button" name="mMilligram_bt" value="Go!" /></td>
</tr>
<tr><th class="headings" colspan="3" bgcolor="#103e78"> </th></tr>
<tr bgcolor="#0066ff"><th class="headings" colspan="3" bgcolor="#1765BB">Troy weight</th></tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Pound (lb t)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyPound" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyPound.value)) compute(this.form,troyPound.name,weight_data)" type="button" name="troyPound_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Ounce (oz t)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyOunce" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyOunce.value)) compute(this.form,troyOunce.name,weight_data)" type="button" name="troyOunce_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">PennyWeight (dwt)</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyDWT" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyDWT.value)) compute(this.form,troyDWT.name,weight_data)" type="button" name="troyDWT_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" width="288">Grain<br /> Same as Avoirdupois grain</td>
<td class="headings" align="right" bgcolor="#103e78" width="130"><input type="text" name="troyGrain" size="15" /></td>
<td class="headings" bgcolor="#103e78" width="57"><input onclick="if (checkNum(troyGrain.value)) compute(this.form,troyGrain.name,weight_data)" type="button" name="troyGrain_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#6699ff">
<td class="headings" colspan="3" bgcolor="#103e78"> </td>
</tr>
<tr bgcolor="#0066ff"><th class="headings" colspan="3" bgcolor="#1765BB">Avoirdupois weight</th></tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">British ("long") ton</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="briTon" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(briTon.value)) compute(this.form,briTon.name,weight_data)" type="button" name="briTon_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">US ("short") ton</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="usTon" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(usTon.value)) compute(this.form,usTon.name,weight_data)" type="button" name="usTon_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78" height="42">British ("long") hundredweight (cwt)</td>
<td class="headings" align="right" bgcolor="#103e78" height="42"><input type="text" name="briCWT" size="15" /></td>
<td class="headings" bgcolor="#103e78" height="42"><input onclick="if (checkNum(briCWT.value)) compute(this.form,briCWT.name,weight_data)" type="button" name="briCWT_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">US ("short") hundredweight (cwt)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="usCWT" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(usCWT.value)) compute(this.form,usCWT.name,weight_data)" type="button" name="usCWT_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Stone</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="briStone" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(briStone.value)) compute(this.form,briStone.name,weight_data)" type="button" name="briStone_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Pound (lb)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpPound" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpPound.value)) compute(this.form,avdpPound.name,weight_data)" type="button" name="avdpPound_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Ounce (oz)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpOunce" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpOunce.value)) compute(this.form,avdpOunce.name,weight_data)" type="button" name="avdpOunce_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Dram (dr)</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpDram" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpDram.value)) compute(this.form,avdpDram.name,weight_data)" type="button" name="avdpDram_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" bgcolor="#103e78">Grain</td>
<td class="headings" align="right" bgcolor="#103e78"><input type="text" name="avdpGrain" size="15" /></td>
<td class="headings" bgcolor="#103e78"><input onclick="if (checkNum(avdpGrain.value)) compute(this.form,avdpGrain.name,weight_data)" type="button" name="avdpGrain_bt" value="Go!" /></td>
</tr>
<tr bgcolor="#0066ff">
<td class="headings" colspan="2" align="center" bgcolor="#103e78"><input onclick="resetAll(this.form)" type="button" name="res7" value="Clear all numbers" /></td>
<td class="headings" bgcolor="#103e78"> </td>
</tr>
</tbody>
</table>
<p> </p>
</form>
<p> </p>
and help will be greatly appreciated.