Forum Discussion
JackFretwell
7 years agoQrew Assistant Captain
Hiya, is there a limit to how many of these buttons you can have on one form? And is there a specific naming convention? Having used "-" would "--" be okay?
JackFretwell
7 years agoQrew Assistant Captain
And again would like someone to check my code, I can't get the second button responding, I'm learning Java, I kinda just go with what works but introducing a second button has stumped me again.
I do repeat the name of the first button a few times in the function (which calls fields from another table).
All I have as a function in the second button is an alert of hello world. I'm sure my code can be compacted considerably.
The bit not working is under UK POSTAGE QUOTES.
---------------------------------------------------------------------------------------------------
(function(){
let dbid = "bneccwxvi";
let dbidEstimates = "bn2pkzhui";
let dbidReference = "bn2piqtei";
let dbidUKPostage = "bn5zj7vzd";
$.ajaxSetup({data: {apptoken: apptoken}});
// ------------ENVELOPE ENCLOSING-------------------------------------------------------------------------------
// Envelope Enclosing Set Up Costs
$("a.QBU_UpdateQuote").on("click", function(event) {
// Envelope Enclosing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_49.value ;
_fid_77.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_77.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Envelope Enclosing Per Item
let rid = this.dataset.rid;
let refcode = _fid_49.value ;
_fid_56.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_56.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Envelope Enclosing Minimum
let rid = this.dataset.rid;
let refcode = _fid_49.value ;
_fid_81.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_81.value = $("minimumcost", xml).text();
})
});
});
// -----HAND ENCLOSING---------------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Hand Enclosing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_50.value;
_fid_78.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_78.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Hand Enclosing Per Item
let rid = this.dataset.rid;
let refcode = _fid_50.value;
_fid_57.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_57.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Hand Enclosing Min
let rid = this.dataset.rid;
let refcode = _fid_50.value ;
_fid_82.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_82.value = $("minimumcost", xml).text();
})
});
});
// ------------INK JET PRINTING------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Inkjet Printing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_51.value ;
_fid_79.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_79.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Inkjet Printing Per Item
let rid = this.dataset.rid;
let refcode = _fid_51.value ;
_fid_58.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_58.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Inkjet Printing Minimum Value
let rid = this.dataset.rid;
let refcode = _fid_51.value ;
_fid_83.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_83.value = $("minimumcost", xml).text();
})
});
});
// ------------POLY WRAPPING------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Poly Wrapping Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_52.value ;
_fid_80.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_80.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Poly wrapping Per Item
let rid = this.dataset.rid;
let refcode = _fid_52.value ;
_fid_59.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_59.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Poly Wrapping Minimum Value
let rid = this.dataset.rid;
let refcode = _fid_52.value ;
_fid_84.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_84.value = $("minimumcost", xml).text();
})
});
});
// ------------FINISHING------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Finishing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_184.value ;
_fid_186.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_186.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Finishing Item Costs
let rid = this.dataset.rid;
let refcode = _fid_184.value ;
_fid_187.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_187.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Finishing Minimum Value
let rid = this.dataset.rid;
let refcode = _fid_184.value ;
_fid_189.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_189.value = $("minimumcost", xml).text();
})
});
});
// ------------UK POSTAGE QUOTES------------------------------------------------------------------------------------
// This collects item costs from the UK Postage Table
$("a.QBU_UKPost").on("click", function(event) {
let rid = this.dataset.rid;
let refcode = _fid_166.value;
let refcol = _fid_214.value;
let refdesc = _fid_221.value;
let messageone = ' "hello world"';
alert(messageone);
});
})();
I do repeat the name of the first button a few times in the function (which calls fields from another table).
All I have as a function in the second button is an alert of hello world. I'm sure my code can be compacted considerably.
The bit not working is under UK POSTAGE QUOTES.
---------------------------------------------------------------------------------------------------
(function(){
let dbid = "bneccwxvi";
let dbidEstimates = "bn2pkzhui";
let dbidReference = "bn2piqtei";
let dbidUKPostage = "bn5zj7vzd";
$.ajaxSetup({data: {apptoken: apptoken}});
// ------------ENVELOPE ENCLOSING-------------------------------------------------------------------------------
// Envelope Enclosing Set Up Costs
$("a.QBU_UpdateQuote").on("click", function(event) {
// Envelope Enclosing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_49.value ;
_fid_77.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_77.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Envelope Enclosing Per Item
let rid = this.dataset.rid;
let refcode = _fid_49.value ;
_fid_56.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_56.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Envelope Enclosing Minimum
let rid = this.dataset.rid;
let refcode = _fid_49.value ;
_fid_81.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_81.value = $("minimumcost", xml).text();
})
});
});
// -----HAND ENCLOSING---------------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Hand Enclosing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_50.value;
_fid_78.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_78.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Hand Enclosing Per Item
let rid = this.dataset.rid;
let refcode = _fid_50.value;
_fid_57.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_57.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Hand Enclosing Min
let rid = this.dataset.rid;
let refcode = _fid_50.value ;
_fid_82.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_82.value = $("minimumcost", xml).text();
})
});
});
// ------------INK JET PRINTING------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Inkjet Printing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_51.value ;
_fid_79.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_79.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Inkjet Printing Per Item
let rid = this.dataset.rid;
let refcode = _fid_51.value ;
_fid_58.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_58.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Inkjet Printing Minimum Value
let rid = this.dataset.rid;
let refcode = _fid_51.value ;
_fid_83.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_83.value = $("minimumcost", xml).text();
})
});
});
// ------------POLY WRAPPING------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Poly Wrapping Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_52.value ;
_fid_80.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_80.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Poly wrapping Per Item
let rid = this.dataset.rid;
let refcode = _fid_52.value ;
_fid_59.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_59.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Poly Wrapping Minimum Value
let rid = this.dataset.rid;
let refcode = _fid_52.value ;
_fid_84.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_84.value = $("minimumcost", xml).text();
})
});
});
// ------------FINISHING------------------------------------------------------------------------------------
$("a.QBU_UpdateQuote").on("click", function(event) {
// Finishing Set Up Costs
let rid = this.dataset.rid;
let refcode = _fid_184.value ;
_fid_186.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "14"
}).then(function(xml){
$("record", xml).each(function() {
_fid_186.value = $("set_up_cost", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Finishing Item Costs
let rid = this.dataset.rid;
let refcode = _fid_184.value ;
_fid_187.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_187.value = $("peritem", xml).text();
})
});
});
$("a.QBU_UpdateQuote").on("click", function(event) {
// Finishing Minimum Value
let rid = this.dataset.rid;
let refcode = _fid_184.value ;
_fid_189.value = "0.00"
$.get(dbidReference , {
act: "API_DoQuery",
query: '{8.EX.${refcode}}',
clist: "10"
}).then(function(xml){
$("record", xml).each(function() {
_fid_189.value = $("minimumcost", xml).text();
})
});
});
// ------------UK POSTAGE QUOTES------------------------------------------------------------------------------------
// This collects item costs from the UK Postage Table
$("a.QBU_UKPost").on("click", function(event) {
let rid = this.dataset.rid;
let refcode = _fid_166.value;
let refcol = _fid_214.value;
let refdesc = _fid_221.value;
let messageone = ' "hello world"';
alert(messageone);
});
})();