isee Posted July 11, 2012 Share Posted July 11, 2012 Im trying to create a form with JS/html . Please look at image as an example of the mechanism .So far i got this and all it does is add up stuff..<html><head><script language="javascript">function AddInputs(){var total = 0;var coll = document.getElementsByTagName("input")for ( var i = 0; i<coll.length; i++){var ele = coll;total += parseInt(ele.value);}var Display = document.getElementById("Display");Display.innerHTML = total;}</script></head><body><input onkeyup="AddInputs()" /><input onkeyup="AddInputs()" /><input onkeyup="AddInputs()" /><span id="Display" style="float:right;background:red;"></span></body></html>So i need help if someone knows how to allow quantity multiplication :S and even with adding this is basically like a form that allows people to just input some numbers and quantity to see a subtotal NO this is not for ecommerce . Link to comment Share on other sites More sharing options...
elmohack Posted July 11, 2012 Share Posted July 11, 2012 wooho! Link to comment Share on other sites More sharing options...
justsomeguy Posted July 11, 2012 Share Posted July 11, 2012 There's no secret to multiplying numbers, the multiplication operator is "*". The image you posted isn't coming through though. Link to comment Share on other sites More sharing options...
elmohack Posted July 12, 2012 Share Posted July 12, 2012 Im not sure how to do this so far i only manage to create addition i found the script on the interwebz but i cant find one that allows multiplication and addition .. so if someone can please help :C Link to comment Share on other sites More sharing options...
birbal Posted July 12, 2012 Share Posted July 12, 2012 http://w3schools.com/js/js_operators.aspyou can find here info about js oparators and how they work Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now