BarneyJoe Posted November 23, 2006 Share Posted November 23, 2006 Hope someone can help with this.I basically have a table 'Photos', table 'Keywords', and a table 'Photo_Keywords'. The idea is that users can add a selection of relevant keywords to a photo using a screen full of keywords by checking the appropriate boxes.I'm having trouble on my edit keywords page tho' - I initially got it working, but without the existing keyword checkboxes being checked, and am now trying to get the keyword selection to persist when a user selects the edit keywords page from the photo detail page.My recordset on the update keywords page is using table 'Photo_Keywords', and is filtering using the Photo_ID as URL parameter.I then have the checkboxes as Dynamic and setting them to be checked should there be a match on Keyword_ID, like :<input type='hidden' name='Photo_ID' value='<?php echo $Photo_ID; ?>'>Ancient Monument<input <?php if (!(strcmp($row_Keyword_Match['Keyword_ID'],2))) {echo "checked";} ?> name="ckbox[2]" type="checkbox" class="tickbox2" id="ckbox[2]">Aquarium<input <?php if (!(strcmp($row_Keyword_match['Keyword_ID'],3))) {echo "checked";} ?> name="ckbox[3]" type="checkbox" class="tickbox2" id="ckbox[3]">etc.The problem is that only the first matched checkbox is appearing as checked, and the others as unckecked.Hopefully that makes some sense, and if anyobne can spot what is wrong it would be greatly appreciated.Cheers,Iain Link to comment https://forums.phpfreaks.com/topic/28258-checkbox-question-editing-an-existing-selection/ Share on other sites More sharing options...
Barand Posted November 23, 2006 Share Posted November 23, 2006 See my reply to an identical situationhttp://www.phpfreaks.com/forums/index.php/topic,114954.0.html Link to comment https://forums.phpfreaks.com/topic/28258-checkbox-question-editing-an-existing-selection/#findComment-129300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.