Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all.

How can I checked the checkbox through while loop.

while($result2=mysql_fetch_array($record2))
{
echo $result2['day'];
}

as above
I want to checked days, but don't know how to selected checkbox?
Posted
Updated 16-Nov-10 22:41pm
v3
Comments
Dalek Dave 17-Nov-10 4:37am    
I have done my best with it, editing wise, but it is still unclear.
Sunny s 17-Nov-10 5:16am    
how to checked the checkbox automatically?

1 solution

<pre lang="C++">for (int i = 0; i ++; gvFieldLevelEditChecks.Rows.Count; i++)
{
GridViewRow gvRow = gvFieldLevelEditChecks.Rows[i];

HiddenField hdnFieldId = (HiddenField)gvRow.FindControl(&quot;hdnFieldId&quot;);

bool isChecked = ((CheckBox)gvRow.FindControl(&quot;checkboxbutton&quot;)).Checked;

if (isChecked)
{
objFieldLevelEditChecksBEO.FieldId = Convert.ToInt32(hdnFieldId.Value);
objFieldLevelEditChecksBEO.Action = ddlOperation.SelectedItem.Text;
objFieldLevelEditChecks.UpdateFieldLevelEditCheckStatus(objFieldLevelEditChecksBEO);
statusChange = true;
}
else
{
Response.write("Select a checkbox")
}

}</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900