public
Created — forked from /gist:1742436

MrShake - pastebin.com/qSTY96AP

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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">

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.