PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

javascript input validation, input attributes

  1. eriksan
    Member

    Hello! I would like to make a form that uses an existing javascript to validate diffrent inputs depending on user choice (on submit or even better inline). For example:

    [Dropdown with 2 choices: A and B]
    If user choses A: Show and js-validate Input C
    If user choses B: Show and js-validate input D

    I love how easy it seems to show/hide inputs with the conditonal logic feature but how would I go about achieving the conditional validation with gravity forms?

    The form connects to a customer management system (an aspx file on the server) and the <inputs> have name attrubutes: name="123" Is it possible to set custom attributes on gravity form's inputs? How?

    Posted 13 years ago on Thursday February 2, 2012 | Permalink
  2. Yes, this is possible. You can add jQuery or JavaScript to the front end.

    Also, each element in Gravity Forms has a unique ID or class, and where none exist, you can modify or add to them by using the gform_pre_render filter to modify the form before it's displayed.

    Posted 13 years ago on Tuesday February 7, 2012 | Permalink