twilitegxa Posted July 30, 2009 Share Posted July 30, 2009 I need to know how to create a function that can multiply 10 by the value of the selected field in the option input field. Here is my form: <form> <table> <thead> <tr> <th>Attribute</th> <th>Level</th> </tr> </thead> <tbody> <tr> <td> <input type="text" value="Scout/Knight Attribute" size="19" name="attribute" /> </td> <td> <select name="attribute_level"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> </select> </td> </tr> </tbody> </table> <br /> </form> Quote Link to comment Share on other sites More sharing options...
twilitegxa Posted July 30, 2009 Author Share Posted July 30, 2009 I figured it out. :-) function power() { var first,res1; //Take the value of first textbox and convert it to float first=parseFloat(document.forms[0].attribute_level.value); res1=(first)*10; //show the result in the result textbox document.forms[0].power_points.value=res1; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.