Jump to content

checkbox


harlequeen

Recommended Posts

Hi

 

I have a league tables results entry page which is generated by calling the teams in a particular division into a form. In the form I have a checkbox as I want to enter the points scored then check the checkbox so that when I submit the results the checkbox is showing that a result has been posted and adds one to the total of games played.

 

Some of the boxed don't get checked as I don't get the scores all at the same time.  However, when I submit the form, the info in the database is adding 1 to the games played total, whether the checkbox is checked or not. 

 

<input type="checkbox" name='resultPosted[]' size="1" value="<? echo $row['resultPosted'];?>"></td>

 

and I set the resultPosted variable to 'unchecked' at the beginning of the form and here is my if statement, setting the games played.

 

If ($resultPosted="checked") 
{
$played=$played+1;
}
else  {
$played=$played;
}

 

Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/242186-checkbox/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.