newb database/form help
Permalink
so i created a single page thats listed under the dashboard. when you go to that page its very very simple. its just two checkboxes.
Grill Season (with checkbox)
and if its grill season is checked... display this:
Grill Open (with checkbox)
i created the table in the database and both values are set to "1".
now i just need help setting up the form to update the database if those are checked or not. below is what i have on the single page php file.
Grill Season (with checkbox)
and if its grill season is checked... display this:
Grill Open (with checkbox)
i created the table in the database and both values are set to "1".
now i just need help setting up the form to update the database if those are checked or not. below is what i have on the single page php file.
$db = Loader::db(); ... need db update code
<form method="post" id="grill_form" action="<?php echo $_SERVER['PHP_SELF'];?>"> <div class="ccm-dashboard-radio"> <input type="checkbox" name="GrillSeason" value="1" <?php if ($GrillSeason == 1) { ?> checked <?php } ?> /> <?php echo t('Grill Season')?> </div> <?php if ($GrillSeason == 1) { ?> <div class="ccm-dashboard-radio"> <input type="checkbox" name="GrillOpen" value="1" <?php if ($GrillOpen == 1) { ?> checked <?php } ?>/> <?php echo t('Grill Open')?> </div> <?php } ?> <input type="hidden" value="1" name="grill" /> </form> <?php echo $h->submit(t('Save'), 'grill_form', 'left'); ?>
if anyone can provide any direction i would be tremendously grateful. last piece for this site...
bump
Did you ever find a solution to this? If so could you please share? I'd be curious to see what your controller and view ended up looking like.