Action buttons
Sometimes you will want to add a button to a screen layout that triggers a javascript action.
Note: whilst this still provides a good example of hooking buttons, the actually validation example is no longer relavent as the Contact Hub has a built in Validate buttion which calls the standard onValidate method where you can implement your form and field level validation.
To add the button you need to add the following html to your screen layout.
<input id="btnValidate" type="button" value="Validate" />
Change the id and value to suit your purpose.
To hanld the button click you need to add the following code to your javascript:
$.njDialerPlugin.onConnect= function () { // validate the form when the user clicks the 'validate button' $(function() { // Change #btnValidate to match the id you gave your button. $('#btnValidate').click(function() { // add your action here. alert("validation failed"); }); }); }