mardi 18 août 2015

checking tick boxes from data from database

I'll keep this question short. What is going on is that I have a form with tick boxes on. Once the user clicks the text box it will post the data to the database and then show on the form as that option has been selected. But the the tick from the text box disappears. I want to make it so that once the data has been submitted the tick will remain there. There are about 40 boxes so I am expecting the coding to be long for all the different permutations but if someone can help me get started I can replicate it further.

Here is the start of it. The first few hidden values are just there to get the same user so it.

Thanks in advance!

        <table>
        <form name='counter' id='counter' method="get"  >
            <tr><th colspan="8">Counter arrangements</th></tr>  
            <input type="hidden" name="selected" value="<?php echo $selected; ?>" />
            <input type="hidden" name="edited" value="1" /> 
            <input type="hidden" name="evidenceCount" value="<?php echo $selected_evidence_Total; ?>" />
            <input type="hidden" name="arrangementCount" value="<?php echo $selected_arrangement_Total; ?>" />  

            <td valign="top"  >
              <input type="checkbox" Name='arrangements[]'  value='Rest Breaks' OnChange='this.form.submit();'>Rest Breaks</option>
            </td>           
            <td valign="top"  >
              <input type="checkbox" Name='arrangements[]' value='Small Classroom Environment' OnChange='this.form.submit();'>Small Classroom Environment</option>
            </td>
            <td valign="top"  >
              <input type="checkbox" Name='arrangements[]' value='Coloured Overlay' OnChange='this.form.submit();'>Coloured Overlay</option>
            </td>




Aucun commentaire:

Enregistrer un commentaire