Hi,
On submitting the form, I'm trying to place the items of a listbox in a hidden input. It doesn't work. Is my approach correct?
I have a form like this:
<form name="myForm" onsubmit="return listBoxContents(this.Form.sel1)" action="project_selection.php" method="post">
and a function as below:
function listBoxContents(sel1)
{
var selLength1 = sel1.options.length,i,values1='';
for(i=0; i<selLength1; i++)
values1+=sel1.options.value+ ",";
document.myForm.hiddenName.value = values1;
return true;
}
and the hidden value is as follows:
<input type=hidden name="hiddenName" value="initial">
On submitting the form, I'm trying to place the items of a listbox in a hidden input. It doesn't work. Is my approach correct?
I have a form like this:
<form name="myForm" onsubmit="return listBoxContents(this.Form.sel1)" action="project_selection.php" method="post">
and a function as below:
function listBoxContents(sel1)
{
var selLength1 = sel1.options.length,i,values1='';
for(i=0; i<selLength1; i++)
values1+=sel1.options.value+ ",";
document.myForm.hiddenName.value = values1;
return true;
}
and the hidden value is as follows:
<input type=hidden name="hiddenName" value="initial">