Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.