i need to provide values to hidden fields based on what is selected.
<script language="Javascript">
function doSubmit() {
var element;
var form = document.myform;
if (form.C1.checked)
addTF("item1", "cat1"
if (form.C2.checked)
addTF("item2", "cat2"
if (form.C3.checked)
addTF("item3", "cat3"
form.submit();
}
function addTF(x, y){
html = document.getElementsByTagName('DIV')[0].innerHTML;
document.getElementsByTagName('DIV')[0].innerHTML = html+"<input type='hidden' name='menu' value='x'><input type='hidden' name='cat' value='y'><br>";
}
</script>
my problem. when i call the cgi script... i get x and y as values. how do i get the value field to accept item1, item2, cat1, cat2 and so on?
<script language="Javascript">
function doSubmit() {
var element;
var form = document.myform;
if (form.C1.checked)
addTF("item1", "cat1"
if (form.C2.checked)
addTF("item2", "cat2"
if (form.C3.checked)
addTF("item3", "cat3"
form.submit();
}
function addTF(x, y){
html = document.getElementsByTagName('DIV')[0].innerHTML;
document.getElementsByTagName('DIV')[0].innerHTML = html+"<input type='hidden' name='menu' value='x'><input type='hidden' name='cat' value='y'><br>";
}
</script>
my problem. when i call the cgi script... i get x and y as values. how do i get the value field to accept item1, item2, cat1, cat2 and so on?