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.

Form Fields and the name= attribute?

  1. Hi,

    Is it possible to add attributes to form fields. Specifically the Pricing > Products fields.
    I have set Values to each option but need to add this attribute; name="addvalue", in order for the form to communicate with another custom built plugin.

    Is this possible?

    Thanks

    Posted 12 years ago on Monday September 5, 2011 | Permalink
  2. Not from within Gravity Forms, but anything is possible with jQuery.

    http://api.jquery.com/category/attributes/

    Posted 12 years ago on Monday September 5, 2011 | Permalink
  3. The name attributes are dynamically assigned when the form is created and are used as for the conditional logic, validation, etc. That's why there's currently not an option to modify them.

    Wouldn't you be able to add a class name to the parent list item in the form builder, then target the inputs with inheritance from that for your plugin functionality?

    Posted 12 years ago on Monday September 5, 2011 | Permalink
  4. Thanks for your replies,

    This is what I need to achieve;

    I have a form for users to purchase 'credits', which they can use to purchase things within the website. The 'Credits' plugin needs attributes to determine how many credits the user is purchasing. eg: name=19 / name=29

    So I don't think adding a class to the parent element will work with this.

    I will try Chris's way; Changing the name attr using JQuery.

    Thanks

    Posted 12 years ago on Tuesday September 6, 2011 | Permalink
  5. Hi,

    I have tried replacing the name attribute on each form field, from input_1 to the relevant values.
    But then the form throws an error. It seems to strip out the changed name attributes, and then will send the second time round.

    I can't show you a link as you need to sign-up and login to view the form.

    Is there another way of solving this?

    Thanks

    Posted 12 years ago on Tuesday September 6, 2011 | Permalink
  6. You should not replace the name attribute but just add additional attributes. Can you use something other than name, like a class? Replacing the name attribute is going to create problems in Gravity Forms.

    What is the other script/plugin you are trying to integrate with?

    Posted 12 years ago on Tuesday September 6, 2011 | Permalink
  7. It's a custom built Credits Plugin. Which allows user to purchase credits to use within the website.
    I will have to speak to the developer to see if he can change the code.

    Thanks for your help.

    Posted 12 years ago on Wednesday September 7, 2011 | Permalink
  8. OK, please keep us updated.

    Posted 12 years ago on Wednesday September 7, 2011 | Permalink