casinoweirdo
Technical User
my background isn't in java so I need some help.
Is there a way to create a drop down from a list of checkboxes that aren't checked?
I've got 12 checkboxes and I've created a drop down from the ones the user selects, but I need to be able to create a survey questions from the ones that weren't selected.
Here's what I've got so far
<script type="text/javascript">
function moveIt(numboxes) {
var boxes = new Array(numboxes)
clearSelect()
for (i = 0; i < numboxes ; ++i) {
if (document.forms['question2'].question2.checked == true) {
boxes = document.forms['question2'].question2.value
addOption(document.forms['question2'].question3, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes)
}
}
}
function addOption(selectbox,text,value ){
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function clearSelect(){
while (document.forms['question2'].question3.options.length > 1) {
document.forms['question2'].question3.remove(1)
}
}
</script>
<form name="question2">
<table>
<tr>
<p class="MsoNormal">What 5 benefits seem to appeal to your customer the most?
(Please check 5 only)</p>
</tr>
<tr>
<td>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Personal Host"> Personal Host</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Guaranteed value parking"> Guaranteed valet parking</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Food Discounts"> Food Discounts</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Bonus Entries"> Bonus entries for drawings</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Priority seating in our food restaurants"> Priority seating in our food restaurants</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Free hotel stay"> Free hotel stay</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Cash back rewards using earned points"> Cash back rewards using earned points</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Online access to their account"> Online access to their account</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Invistations to special events"> Invitations to special events</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Generous comping program"> Generous
comping program</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Hotel discount rates"> Hotel discount rates</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Monthly coin offers"> Monthly coin offers</p>
<br /><br />
<p class="MsoNormal">Of the above, what 1 benefit do you think your customers value the most?</p><br />
<select name="question3">
</select>
</td>
</tr>
</table>
</form>
Is there a way to create a drop down from a list of checkboxes that aren't checked?
I've got 12 checkboxes and I've created a drop down from the ones the user selects, but I need to be able to create a survey questions from the ones that weren't selected.
Here's what I've got so far
<script type="text/javascript">
function moveIt(numboxes) {
var boxes = new Array(numboxes)
clearSelect()
for (i = 0; i < numboxes ; ++i) {
if (document.forms['question2'].question2.checked == true) {
boxes = document.forms['question2'].question2.value
addOption(document.forms['question2'].question3, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes, boxes)
}
}
}
function addOption(selectbox,text,value ){
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function clearSelect(){
while (document.forms['question2'].question3.options.length > 1) {
document.forms['question2'].question3.remove(1)
}
}
</script>
<form name="question2">
<table>
<tr>
<p class="MsoNormal">What 5 benefits seem to appeal to your customer the most?
(Please check 5 only)</p>
</tr>
<tr>
<td>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Personal Host"> Personal Host</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Guaranteed value parking"> Guaranteed valet parking</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Food Discounts"> Food Discounts</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Bonus Entries"> Bonus entries for drawings</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Priority seating in our food restaurants"> Priority seating in our food restaurants</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Free hotel stay"> Free hotel stay</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Cash back rewards using earned points"> Cash back rewards using earned points</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Online access to their account"> Online access to their account</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Invistations to special events"> Invitations to special events</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Generous comping program"> Generous
comping program</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Hotel discount rates"> Hotel discount rates</p>
<p class="MsoNormal">
<input type="checkbox" name="question2" onclick=moveIt(12) value = "Monthly coin offers"> Monthly coin offers</p>
<br /><br />
<p class="MsoNormal">Of the above, what 1 benefit do you think your customers value the most?</p><br />
<select name="question3">
</select>
</td>
</tr>
</table>
</form>