/
Action buttons
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"); }); }); }
Related content
05.5. Javascript Editor
05.5. Javascript Editor
More like this
Screen Layout Action Scripts
Screen Layout Action Scripts
More like this
Populating Fields
Populating Fields
More like this
05.5.4 Field Validation
05.5.4 Field Validation
More like this
4.0 Example
4.0 Example
More like this
1.0 Integration
1.0 Integration
More like this