I am trying to take radio and checkbox values from an HTML form, and save/export/pass the values to an external javascript file where the TaffyDB structured database is initialized.
HTML:
<strong> <font color="black">Color</strong></font>
<form name="colorForm">
<input type="checkbox" name="color" value="Red">
<font color="black">Red
<br>
</font>
<input type="checkbox" name="color" value="Orange">
<font color="black">Orange
<br>
</font>
<input type="checkbox" name="color" value="Yellow">
<font color="black">Yellow
<br>
<!--function to return checkbox values for colors-->
<script type="text/javascript">
function get_color() {
//console.log(document.colorForm);
for (var i = 0; i < document.colorForm.length; i++) {
while (document.colorForm[i].checked && i < document.colorForm.length) {
var check_color = document.colorForm[i].value;
return check_color;
colorList.insert({color:get_color});
}//end of while
}//end of for
}//end of get_color
</script>
JavaScript:
var colorList = TAFFY();