Hello again,
I am working on a series of forms for managing a personal budget. I have already created a few forms for creating categories and sub-categories and one form for imputing an amount for the sub-category under a certain year and a certain month. The category and sub-category forms have their own tables - but I have not yet created the budget table (for fear I might mess up if I don't think this through).
What I would like to be able to do is allow the user to radio select whether they want the Budgeted amount to apply to all the months in the year or just to the selected month.
here is the FormHTML I have so far
NOTE: I am using ajax to populate the sub-categories drop down.
Any Idea how I might accomplish this?
Let me know if I have not been clear,
I am working on a series of forms for managing a personal budget. I have already created a few forms for creating categories and sub-categories and one form for imputing an amount for the sub-category under a certain year and a certain month. The category and sub-category forms have their own tables - but I have not yet created the budget table (for fear I might mess up if I don't think this through).
What I would like to be able to do is allow the user to radio select whether they want the Budgeted amount to apply to all the months in the year or just to the selected month.
here is the FormHTML I have so far
<?php
global $mainframe;
$database =& JFactory::getDBO();
$database->setQuery( '
SELECT
category_name,cat_id
FROM jos_chronoforms_excategories
WHERE 1
');
$database->query();
$records = $database->loadAssocList();
?>
<div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text">Budget Goal by Month</h1>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Select Year:</label>
<select class="cf_inputbox validate-selection" id="select_1" size="1" title="" name="select_year">
<option value="">Choose Option</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Select Month:</label>
<select class="cf_inputbox validate-selection" id="select_2" size="1" title="" name="select_month">
<option value="">Choose Option</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_radiobutton">
<label class="cf_label" style="width: 150px;">Apply To:</label>
<div class="float_left">
<input value="Selected Month" title="" class="radio validate-one-required" id="radio00" name="radio0" type="radio" />
<label for="radio00" class="radio_label">Selected Month</label>
<br />
<input value="All Months" title="" class="radio validate-one-required" id="radio01" name="radio0" type="radio" />
<label for="radio01" class="radio_label">All Months</label>
<br />
</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Expendature Type:</label>
<select class="cf_inputbox" id="select_category" size="1" title="" name="select_category" onchange="htmlData('http://localhost/andy/items.php', 'ch='+this.value)" >
<option value="">Choose Option</option>
<?php
// List of Categories
foreach( $records as $row ) {
echo '<option value="'.$row[cat_id].'">'.$row[category_name].'</option>';
}
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Item Type:</label>
<div id="txtResult">
<select class="cf_inputbox" id="select_subcat" size="1" title="" name="select_subcat">
<option value="">Choose Option</option>
</select>
</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Budget Amount:</label>
<input class="cf_inputbox required validate-currency-dollar" maxlength="150" size="30" title="" id="text_7" name="budget_amount" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_8" type="submit" /><input type="reset" name="reset" value="Reset"/>
</div>
<div class="cfclear"> </div>
</div>
NOTE: I am using ajax to populate the sub-categories drop down.
Any Idea how I might accomplish this?
Let me know if I have not been clear,