Forum Discussion
EOMDevelepors
7 years agoQrew Captain
Thanks Dan!
I am doing this in myCript page.
I have a prompt:
var description= prompt("Enter a brief description of the work done in this session: ", "");
if the user cancels within the prompt window then don't want to run the code. I tried putting the if statement but it does not seem to work:
See in bold what I added
(function(){
var dbid = "bnqepesti";
var dbidTable = dbid;
var apptoken = "my app token";
$.ajaxSetup({data: {apptoken: apptoken}});
var description= prompt("Enter a brief description of the work done in this session: ", "");
if(confirm("Do you want to continue?")) {
var promise = $.get(dbidTable, {
act: "API_EditRecord",
rid: QBU_rid,
_fid_20: description,
_fid_6: "Out"
}).then(function(xml) {
console.dirxml(xml);
$.get() & location.reload(true);
});
})();}
I am doing this in myCript page.
I have a prompt:
var description= prompt("Enter a brief description of the work done in this session: ", "");
if the user cancels within the prompt window then don't want to run the code. I tried putting the if statement but it does not seem to work:
See in bold what I added
(function(){
var dbid = "bnqepesti";
var dbidTable = dbid;
var apptoken = "my app token";
$.ajaxSetup({data: {apptoken: apptoken}});
var description= prompt("Enter a brief description of the work done in this session: ", "");
if(confirm("Do you want to continue?")) {
var promise = $.get(dbidTable, {
act: "API_EditRecord",
rid: QBU_rid,
_fid_20: description,
_fid_6: "Out"
}).then(function(xml) {
console.dirxml(xml);
$.get() & location.reload(true);
});
})();}