Here is the code that i written:
<script>
function myFunction(var num)
{
alert("Claim form has been successfully created with reference number:" + num);
}
<apex:commandButton action="{!submit}" value="Submit" oncomplete="myFunction({!Case.Claim_Reference__c});"/>
Attribution to: Vishwesh Prabhakar
Possible Suggestion/Solution #1
Add single quote when you call your field. Also if you set your Clain_Reference__c into your submit method, you will need to reRend your button or the section.
<apex:commandButton action="{!submit}" value="Submit" oncomplete="myFunction('{!Case.Claim_Reference__c}');"/>
Attribution to: Cloud Ninja
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/31478