currently i'm still develop a custom pre-chat for my org, and i have a problem in here.
here is my custom pre-chat i've created
whenever i tried to submit "click to chat" button, it doesn't connect to an agent even though the agent is already on 'online' status. am i missing something in here?
For reference here is my pre-chat code ;
<apex:page >
<script type='text/javascript'>
(function() {
function handlePageLoad() {
var endpointMatcher = new RegExp("[\\?\\&]endpoint=([^&#]*)");
document.getElementById('prechatForm').setAttribute('action',decodeURIComponent(endpointMatcher.exec(document.location.search)[1]));
} if (window.addEventListener) {
window.addEventListener('load', handlePageLoad, false);
} else { window.attachEvent('onload', handlePageLoad, false);
}})();
</script>
<h1>Pre-Chat Form</h1>
<!-- Form that gathers information from the chat visitor and sets the values to Chat Custom Details used later in the example -->
<form method='post' id='prechatForm'>
First name: <input type='text' name='liveagent.prechat:LiveChatTranscriptFirst_Name__c' id='firstName' /><br />
Last name: <input type='text' name='liveagent.prechat:LiveChatTranscriptLastName' id='lastName' /><br />
Unit Model: <input type='text' name='liveagent.prechat:LiveChatTranscriptUnit_Model__c' id='unit_model' /><br />
Serial Number: <input type='text' name='liveagent.prechat:LiveChatTranscriptSerial_Number__c' id='serial_number' /><br />
<input type="hidden" name="liveagent.prechat.name" id="prechat_field_name" />
<input type='submit' value='Click to Chat' id='prechat_submit' />
<input type= "hidden" name="liveagent.prechat.findorcreate.linkToEntity:Account" value="Case,AccountId" />
<style type="text/css">
p {font-weight: bolder }
</style>
</form>
</apex:page>
and here is my button config which is i'm already add my VFP pages on it
and one thing, when i looked into browser console i get this message info, is it related?
thanks in advance.
1 answer
Hi Irfan,
Sorry for the inconvenience. In case you don't receive a response here, may I also suggest joining the group below to collaborate with the experts for best practice and advice.
https://developer.salesforce.com/forums#!/feedtype=RECENT&criteria=ALLQUESTIONS&
Hope this helps.
Regards,
#.redirect