ramki067
03-03-2008, 04:11 AM
Hi,
I'm passing the checkboxes which are clicked to the next form. But if i click the checkboxes and submit it the values are not reflected in the next form. But if i go back and refresh the page using F5 and then click the checkboxes and click Submit the values are passed to next form! What could be the reason for this? Please help.
Thanks,
Ramki.
foreach($lines as $line_num => $line)
{
preg_match('/\t([-\w]+)[^\t]*\t([-\w]+)/', $line, $matches);
echo "<font size=3><tr bgcolor=$bgc><td>$j</td>";
echo "<td>$matches[1]</td>";
$streams[$k]= $matches[1];
if($matches[1]!="")
{
$stream_lines[$k]=$line;
}
echo "<td><center><input name=\"sstreamname\" type=\"checkbox\" onclick=\"check();\"></center></td></tr></font></center></tr></font></center>";
$j++;
$k++;
}
The below is the javascript function:
function check()
{
var frm=document.forms.stream_selection
sel_num = new Array();
Parr = new Array();
for(j=1;j<1000;j++)
{
if(frm[j] != null)
{
if(!frm[j].checked)
{
frm[0].checked=false;
}
else
{
Parr.push(j);
ParrStr=Parr.join(',');
}
}
}
document.getElementById('ParrStr').value=ParrStr;
}
I'm passing the checkboxes which are clicked to the next form. But if i click the checkboxes and submit it the values are not reflected in the next form. But if i go back and refresh the page using F5 and then click the checkboxes and click Submit the values are passed to next form! What could be the reason for this? Please help.
Thanks,
Ramki.
foreach($lines as $line_num => $line)
{
preg_match('/\t([-\w]+)[^\t]*\t([-\w]+)/', $line, $matches);
echo "<font size=3><tr bgcolor=$bgc><td>$j</td>";
echo "<td>$matches[1]</td>";
$streams[$k]= $matches[1];
if($matches[1]!="")
{
$stream_lines[$k]=$line;
}
echo "<td><center><input name=\"sstreamname\" type=\"checkbox\" onclick=\"check();\"></center></td></tr></font></center></tr></font></center>";
$j++;
$k++;
}
The below is the javascript function:
function check()
{
var frm=document.forms.stream_selection
sel_num = new Array();
Parr = new Array();
for(j=1;j<1000;j++)
{
if(frm[j] != null)
{
if(!frm[j].checked)
{
frm[0].checked=false;
}
else
{
Parr.push(j);
ParrStr=Parr.join(',');
}
}
}
document.getElementById('ParrStr').value=ParrStr;
}