I'm using the apprise function, yes to return true and No to returns false
I am using this to validate a control with the onclientclick method.
The return parameter does not seem to make it back as the function is nested.
Anyone know how I can properly return to the test(e) method
function test(e) {
apprise('Are you sure you want to add a 12 Month Donation?', { 'verify': true },
function (r) {
if (r) {
// user clicked 'Yes'
apprise("Donation Added");
}
else {
// user clicked 'No'
return false;
}
});
}
I've edited the java script to what Thomas has recommended but by validation still doesnt seem to work although the JS function above is returning the correct parameters
Here is the edited JS and the asp part. the onclick method never seems to be reached in the new code but the return parameters are correct
OnClientClick ="if (!test()) {return false;}"
onclick="btn12MonthDonate"
function test() {
function donationAdded() {
console.log("yes");
return true;
};
function donationNotAdded() {
console.log("no");
return false;
};
apprise('Are you sure you want to add a 12 Month Donation?', { 'verify': true },
function (r) {
if (r) {
// user clicked 'Yes'
apprise("Donation Added");
donationAdded();
}
else {
// user clicked 'No'
donationNotAdded();
}
});
}