[email protected] Posted June 22, 2010 Share Posted June 22, 2010 Anytime i check the checkbox on the page and i return to the page, the checkbox always is empty by not saving. I really need help on this guys. Thanks. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/205591-checkbox-is-not-working/ Share on other sites More sharing options...
Pikachu2000 Posted June 22, 2010 Share Posted June 22, 2010 Do yourself a favor and get rid of the short open tags and quick echo tag syntax. Use the long tags; it will make your life easier in the long run. [-]The proper HTML syntax ( I believe) to display a checkbox is <input type="checkbox" name="checkbox" checked="checked">[/-] <--- Nevermind, I was thinking of the selected="selected" syntax in an <option></option> tag. EDIT: Have you checked the page HTML source to see what the tags look like? Quote Link to comment https://forums.phpfreaks.com/topic/205591-checkbox-is-not-working/#findComment-1075831 Share on other sites More sharing options...
[email protected] Posted June 22, 2010 Author Share Posted June 22, 2010 Yes i checked the HTML and everything looks fine... what do u think could be the mistake. Quote Link to comment https://forums.phpfreaks.com/topic/205591-checkbox-is-not-working/#findComment-1075840 Share on other sites More sharing options...
Pikachu2000 Posted June 22, 2010 Share Posted June 22, 2010 By looks fine, do you mean the checkbox tags have "checked" in them where they're supposed to, but still aren't checked on the page? Quote Link to comment https://forums.phpfreaks.com/topic/205591-checkbox-is-not-working/#findComment-1075851 Share on other sites More sharing options...
[email protected] Posted June 22, 2010 Author Share Posted June 22, 2010 the check have checked in them, when i checked them they will check, but if i return to the page to see if it checked the checkbox is always empty... Quote Link to comment https://forums.phpfreaks.com/topic/205591-checkbox-is-not-working/#findComment-1075855 Share on other sites More sharing options...
ChemicalBliss Posted June 22, 2010 Share Posted June 22, 2010 1. If your using the "Browser Back Button": Your brower is not storing the previous page's form data (Not Caching its history). I believe firefox does this by default - unless the page has no cache headers/metas). 2. If your reloading the page (clicking a link/refreshing), You need to save the data somehow, simply making a html form and trying to make it save its state wont work. You need tangible variables tored either in a Browser Cookie/File on Server or DB on Server. Hope this helps. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205591-checkbox-is-not-working/#findComment-1075867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.