I have two Javascript functions:
<script>
function confirmTransfer() {
var tasks = "{!totalTasks}";
var matches = "{!totalMatches}";
var contacts = "{!totalContacts}";
var transfer = confirm("Are you sure you wish to transfer: " +
tasks + " tasks, " + matches + " matches, and " + contacts " contacts?");
if (transfer) return true;
return false;
}
function confirmCancel() {
var isCancel = confirm("Are you sure you wish to cancel?");
if (isCancel) return true;
return false;
}
</script>
for some reason, just the confirmCancel function does what I want it do. The confirmTransfer button simply goes sstraight to the function call in the commandButton:
<apex:commandButton action="{!cancel}" value="Cancel"
onclick="return confirmCancel()"immediate="true"/>
<apex:commandButton action="{!step4}" value="Transfer"
onclick="return confirmTransfer()" immediate="true"/>
When I click Transfer, I see this in the console:
transfercontacts:137 Uncaught ReferenceError: confirmTransfer is not defined
The syntax is the same, can anyone explain what this could be?
Thanks in advance!