Javascript: collect data from a form for a function
Posted: Sun Sep 07, 2008 6:56 am
Hi!
I'm trying to collect data from a form to use in a function, but it doesn't seem to be working. I'm using Dreamweaver to write the code. Here is what I have. This is the JS function that I use.
This is the code for the form. Please ignore the other text fields. They aren't used for now
When I use this form and click Calculate button, the form clears but the value I input in the textfield "db" isn't printed.
I'm trying to collect data from a form to use in a function, but it doesn't seem to be working. I'm using Dreamweaver to write the code. Here is what I have. This is the JS function that I use.
Code: Select all
<script type="text/javascript">function printnum(){$ft = document.getElementById('db').valueDocument.Write($ft)}</script>Code: Select all
<form id="form1" name="form1" > <label> <input type="text" name="db" /> Dry Bulb Temp(Celsius)</label> <p> <label> <input type="text" name="wb" /> Wet Bulb Temp(Celsius)</label> </p> <p> <label> <input type="text" name="pr" /> Ambient Pressure(Millibars)</label></p> <p> <label> <input type="submit" name="Submit" value="Calculate" onclick="printnum(document.form1)"/> </label> </p></form>