im new with liveagent configuration and i'm trying to get the filled inputs by user to send to the agent. unfortunately I am unable to send the values, i researched but i didn't found solution. thank you
Here the code:
<apex:page showHeader="false">
<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>Atendimento</h1>
<apex:pageBlock >
<form method="post" id="prechatForm">
Nome: <br />
<input type="text" name="liveagent.prechat:name" id="name" /><br />
Sobrenome: <br />
<input type="text" name="liveagent.prechat:lastName" id="lastName" /><br />
Email: <br />
<input type="text" name="liveagent.prechat:email" id="email" /><br /> <br />
<input type="hidden" name="liveagent.prechat:name"
value="Account,Account.Name" />
<input type="hidden" name="liveagent.prechat:lastName"
value="Account,Account.LastName" />
<input type="hidden" name="liveagent.prechat.query:Email" value="Email" />
<a id="liveagent_button_online_XXXXXXXXXXXXX" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('XXXXXXXXXXXXX')">Solicitar Atendimento</a>
<div id="liveagent_button_offline_XXXXXXXXXXXXX" style="display: none;">Desculpe, estamos Offline</div>
<script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('XXXXXXXXXXXXX', document.getElementById('liveagent_button_online_XXXXXXXXXXXXX'));
liveagent.showWhenOffline('XXXXXXXXXXXXX', document.getElementById('liveagent_button_offline_XXXXXXXXXXXXX'));
});
</script>
<script type='text/javascript' src='https://c.XXXXX.salesforceliveagent.com/content/g/js/35.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.XXXX.salesforceliveagent.com/chat', 'XXXXXXXXXXXXX', 'XXXXXXXXXXXXX');
</script>
<style type="text/css">
p {font-weight: bolder }
</style>
</form>
</apex:pageBlock>
</apex:page>