Hye bob,
I tried to add the week and month field. it look like this :
[attachment=0]please.png[/attachment]
in JS Load action i create code like this one :
window.addEvent('domready', function() {
$('text_30').addEvent('change', calculate);
$('radio10').addEvent('click', calculate);
$('text_31').addEvent('change', calculate);
$('radio20').addEvent('click', calculate);
$('text_32').addEvent('change', calculate);
$('radio30').addEvent('click', calculate);
function calculate() {
if ( parseInt($('text_30').value) > 0 && $('radio10').checked ) {
$('totalamount1_id').value = parseInt($('text_30').value) * parseInt($('radio10').value);
else if ( parseInt($('text_31').value) > 0 && $('radio20').checked ) {
$('totalamount2_id').value = parseInt($('text_31').value) * parseInt($('radio20').value);
else if ( parseInt($('text_32').value) > 0 && $('radio30').checked ) {
$('totalamount3_id').value = parseInt($('text_32').value) * parseInt($('radio30').value);
}
};
});
and in form html :
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total Days</label>
<input class="cf_inputbox validate-number validate-digits" maxlength="150" size="30" title="" id="text_30" name="day_id" type="text"/>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_radiobutton">
<label class="cf_label" style="width: 150px;">Staying Status</label>
<div class="float_left">
<input value="60" title="" class="radio" id="radio10" name="radio1" type="radio" />
<label for="radio10" class="radio_label">Day</label>
<br />
</div>
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Staying Status :: Please indicate here if less than one week</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total amount:</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="totalamount1_id" name="totalamount1_id" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total Week</label>
<input class="cf_inputbox validate-number validate-digits" maxlength="150" size="30" title="" id="text_31" name="week_id" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_radiobutton">
<label class="cf_label" style="width: 150px;">Staying Status</label>
<div class="float_left">
<input value="300" title="" class="radio" id="radio20" name="radio2" type="radio" />
<label for="radio20" class="radio_label">Week</label>
<br />
</div>
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Staying Status :: Please indicate here if less than one month</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total amount:</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="totalamount2_id" name="totalamount2_id" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total Month</label>
<input class="cf_inputbox validate-number validate-digits" maxlength="150" size="30" title="" id="text_32" name="month_id" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_radiobutton">
<label class="cf_label" style="width: 150px;">Statying Status</label>
<div class="float_left">
<input value="1000" title="" class="radio" id="radio30" name="radio3" type="radio" />
<label for="radio30" class="radio_label">Month</label>
<br />
</div>
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Statying Status :: Please indicate here if more than one month</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total amount:</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="totalamount3_id" name="totalamount3_id" type="text" />
</div>
<div class="cfclear"> </div>
</div>
Sorry actually i'm still new in programming. Tried to learn. But sometime get stuck in making coding.
Really appreciate your help here.
Thank You.