jquerydrupaljanrain

Janrain custom js validation for registration


I need to validate custom field in janrain registration page which is I am configured in drupal and using as registration. Want to validate using janrain validator functions.


Solution

  • Since your requirement is to do in Drupal, we have few option to achieve this.

    1. Custom Drupal Module by leveraging to jquery-validate
    2. Just Include jQuery-Validate & your custom JS via Theme
    3. Plugin to client side validation module

    For Custom Module (or) Theme implementation, you would required to have your own JS that would do the necessary validation.

    In this JS we need to define bind a new handler for the event onCaptureRenderComplete. Some thing like

    // Bind Validation.
    janrain.events.onCaptureRenderComplete.addHandler(handleValidation);
    

    Once a handler is attached you just define the the custom function handleValidation defined which would take care of validations.

    You can check the complete validation JS @ Sample Validation JS