O
oakura_ape
I have inherited a site that I have ported to ASP.Net 2.0 within the
site I have a checkbox in a datalist ItemTemplate as such:
<TD width="4%"><INPUT class="rach" id="chk_vid" type="checkbox"
name="chk_vid" value="<%#container.dataitem("vid")%>"
runat="server"></TD>
There is some client side validation done on some button presses like
below. It works fine in IE but in fire fox you only ever get an
evaluation returning true if the checkbox in the first item row is
checked
function send_email_submit()
{
vObj_vid=document.all.chk_vid
checked_count=0
chk_vid_comma_string=""
if(vObj_vid.length==undefined)
{
if(vObj_vid.checked==true)
{
chk_vid_comma_string=chk_vid_comma_string + vObj_vid.value
checked_count=checked_count+1
}
}
for(i=0;i<vObj_vid.length;i++)
{
if(vObj_vid.checked)
{
if(checked_count==0)
{
chk_vid_comma_string=chk_vid_comma_string + vObj_vid.value
}
else
{
chk_vid_comma_string=chk_vid_comma_string + "," + vObj_vid.value
}
checked_count=checked_count+1
}
}
if(checked_count>0)
{
document.form2.vid.value=chk_vid_comma_string
document.form2.action="send-email.aspx?return_type=1"
document.form2.submit();
}
else
{
alert("Please specify venue.")
return false;
}
}
Any ideas on where the problem lies would be much appreciated.
site I have a checkbox in a datalist ItemTemplate as such:
<TD width="4%"><INPUT class="rach" id="chk_vid" type="checkbox"
name="chk_vid" value="<%#container.dataitem("vid")%>"
runat="server"></TD>
There is some client side validation done on some button presses like
below. It works fine in IE but in fire fox you only ever get an
evaluation returning true if the checkbox in the first item row is
checked
function send_email_submit()
{
vObj_vid=document.all.chk_vid
checked_count=0
chk_vid_comma_string=""
if(vObj_vid.length==undefined)
{
if(vObj_vid.checked==true)
{
chk_vid_comma_string=chk_vid_comma_string + vObj_vid.value
checked_count=checked_count+1
}
}
for(i=0;i<vObj_vid.length;i++)
{
if(vObj_vid.checked)
{
if(checked_count==0)
{
chk_vid_comma_string=chk_vid_comma_string + vObj_vid.value
}
else
{
chk_vid_comma_string=chk_vid_comma_string + "," + vObj_vid.value
}
checked_count=checked_count+1
}
}
if(checked_count>0)
{
document.form2.vid.value=chk_vid_comma_string
document.form2.action="send-email.aspx?return_type=1"
document.form2.submit();
}
else
{
alert("Please specify venue.")
return false;
}
}
Any ideas on where the problem lies would be much appreciated.