MadsMol Posted July 25, 2012 Share Posted July 25, 2012 Hi. Well. Must admit, i'm a n00b. But i still need your help for something. I want to make a list with several different subjects, let's say it's a .. iPad, a Cellphone, a TV and maybe .. a car .. If people want to buy a iPad and a car, they check the checkbox, press "show me the price" and there's the price .. but i can't get it to work with checkboxes I found this in here, but can't get it "changed" to textboxes .. so please - anyone - help! <html> <body> <script> function add() { var x = document.getElementById("txt1").value; var y = document.getElementById("txt2").value; document.getElementById("sum").value =(x*1)+(y*1); } </script> <form name="frm1"> <input type="text" id="txt1" value="5"> + <input type="text" id="txt2" value="10"><input type="button" value="Add" onclick="add()"> sum<input type="text" id="sum"> </form> </body> </html> Let's play that txt1 is the iPad and txt2 is the car .. How do i change those textboxes into checkboxes? Quote Link to comment Share on other sites More sharing options...
xyph Posted July 25, 2012 Share Posted July 25, 2012 Well, start off by getting the HTML set up the way you want... You're going to need to loop through a set of inputs (the checkboxes) and find out which ones are checked. Quote Link to comment Share on other sites More sharing options...
MadsMol Posted July 25, 2012 Author Share Posted July 25, 2012 And how do i do that? :/ Again, sorry, but i'm really not good at this .. are there any way than you (or anyone else) can give me an example-code? Quote Link to comment Share on other sites More sharing options...
xyph Posted July 25, 2012 Share Posted July 25, 2012 Yeah, provide an attempt, and we'll help you from there. 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.