Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Timothy Johnson
22,480 Pointsdata won't stay
i'm building a checkbox form, and when it's submitted the pops up on new page but it will not stay it pops in then disappear. How can i get it to stay?
function processOrder(){
//var x = document.forms[0].length;
//document.write(x)
var checkBoxes = document.getElementsByTagName('input');
//alert(checkBoxes.length);
var param = "<strong>Meal Plan:</strong>"+"<br>";
for (var counter=0; counter < checkBoxes.length; counter++) {
if (checkBoxes[counter].type.toUpperCase()=='CHECKBOX' && checkBoxes[counter].checked == true) {
param += checkBoxes[counter].value + "<br>";
}
}
document.write(param);
}
1 Answer
Timothy Johnson
22,480 Pointsonce checkboxes are checked and submit button is clicked show values of selected boxes. What is happening right now is the values appear and disappears, I need them the stay and now disappear.
Andrew Shook
31,709 PointsSo is this the goal of the work flow:
- User checks box.
- User clicks submit.
- Hidden value for box selected appears?( this is the part I don't understand).
Andrew Shook
31,709 PointsAndrew Shook
31,709 PointsSorry, but come you explain the problem and your goals with a little more detail and possibly post the html.