1-877-548-3001 Sign in About Contact
Developer

Advancted JS SDK Customization

How do I add/remove fields from the embedded widget forms via JavaScript?

Here's an example of how to remove Subject field from the embedded widget Ticket Submission form. Add this code right after LiveHelpNow embedded widget code:

function lhnJsSdkTicketShown(){
  lhnQuery('*[placeholder="Enter subject"]').val('website inquiry').closest('.lhnField').hide();
}


Disable close chat functionality for the Embedded Widget

function lhnJsSdkEmbeddedOpened(){
  // This function will be called when the embedded window is opened
  lhnQuery('#lhnWindowCloser').click(function(){lhnJsSdk.closeHOC();lhnQuery('.closechat').hide();});
}


Custom code for online/offline events:

<script type="text/javascript">
function lhnStatusUpdate(){
  if(lhnJsSdk.isOnline == true){
    //do something when online
  }else{
    //do something when offline
  }
}
</script>