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> Link to comment https://forums.phpfreaks.com/topic/168092-solved-function-to-multiple-a-value-by-selected-option-in-input-field/ 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; } Link to comment https://forums.phpfreaks.com/topic/168092-solved-function-to-multiple-a-value-by-selected-option-in-input-field/#findComment-886575 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.