Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2012 03:33
Show Gist options
  • Save anonymous/1742436 to your computer and use it in GitHub Desktop.
Save anonymous/1742436 to your computer and use it in GitHub Desktop.
MrShake - pastebin.com/qSTY96AP
window.addEvent('domready', function() {
$('fullconfreg').addEvent('click', calculate);
$('fullconfspouse').addEvent('click', calculate);
$('fullconfregfirsttime').addEvent('click', calculate);
$('intspeechticket').addEvent('click', calculate);
$('evalticket').addEvent('click', calculate);
$('fridinnerham').addEvent('click', calculate);
$('fridinnerroastbeef').addEvent('click', calculate);
$('fridinnerturkey').addEvent('click', calculate);
$('satlunch').addEvent('click', calculate);
$('satdinsteak').addEvent('click', calculate);
$('satdinsalmon').addEvent('click', calculate);
$('satdinveg').addEvent('click', calculate);
function calculate() {
if ( parseInt($('fullconfreg').value) > 0) {
$('totalamount1_id').value = parseInt($('fullconfreg').value) * 15);
if ( parseInt($('fullconfspouse').value) > 0) {
$('totalamount2_id').value = parseInt($('fullconfspouse').value) * 5);
if ( parseInt($('fullconfregfirsttime').value) > 0) {
$('totalamount3_id').value = parseInt($('fullconfregfirsttime').value) * 5);
if ( parseInt($('intspeechticket').value) > 0) {
$('totalamount4_id').value = parseInt($('intspeechticket').value) * 5);
if ( parseInt($('evalticket').value) > 0) {
$('totalamount5_id').value = parseInt($('evalticket').value) * 15);
if ( parseInt($('fridinnerham').value) > 0) {
$('totalamount6_id').value = parseInt($('fridinnerham').value) * 5);
if ( parseInt($('fridinnerroastbeef').value) > 0) {
$('totalamount7_id').value = parseInt($('fridinnerroastbeef').value) * 5);
if ( parseInt($('fridinnerturkey').value) > 0) {
$('totalamount8_id').value = parseInt($('fridinnerturkey').value) * 5);
if ( parseInt($('satlunch').value) > 0) {
$('totalamount9_id').value = parseInt($('satlunch').value) * 5);
if ( parseInt($('satdinsteak').value) > 0) {
$('totalamount10_id').value = parseInt($('satdinsteak').value) * 5);
if ( parseInt($('satdinsalmon').value) > 0) {
$('totalamount11_id').value = parseInt($('satdinsalmon').value) * 5);
if ( parseInt($('satdinveg').value) > 0) {
$('totalamount12_id').value = parseInt($('satdinveg').value) * 5);
var grandtotal = totalamount1_id + totalamount2_id + totalamount3_id + totalamount4_id + totalamount5_id + totalamount6_id
+ totalamount7_id + totalamount9_id + totalamount9_id + totalamount10_id + totalamount11_id + totalamount12_id;
}
};
});
<input type=button value="click here" onClick='alert("This is a tesT")';
style="color: black; background=royalblue; font-size: 8pt; font-weight: bold">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment