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.

Update the NAME attribute of FORM

  1. Hi :)

    I am trying to integrate an eInk signature from a company that does secure forms. I've already got the form POST uri updated to work with this system, which was awesome. I haven't been able to find the answer to this, though:

    I need to be able to add some javascript to the form (just gonna use an HTML block, no big) - but that javascript needs to use the form NAME to work. And the GFs don't seem to HAVE a name attribute. I tried adding one with jQuery but I'm not great with it, and while I am not getting any errors (weird?) it's also not working (boo).

    Trying to use this:

    <script type="text/javascript">
    jQuery("#gform_3").attr('name', 'gf_ellie');
    </script>

    Form is here:

    http://elliefund.org/grant-application/

    Posted 12 years ago on Thursday December 8, 2011 | Permalink
  2. All the forms have an ID already. Can you modify the JavaScript to use the ID rather than the name? If not, can you add that jQuery to the page so we can take a look? I don't see it there now.

    Posted 12 years ago on Friday December 9, 2011 | Permalink
  3. I wish - I don't have control over the script, it's with a third-party service my client is using for e-Ink signatures on the forms.

    Code should be right in the head now.

    Posted 12 years ago on Monday December 12, 2011 | Permalink
  4. Hi rentageekmom,

    Try wrapping your code in jQuery(document).ready():

    [js]
    <script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("#gform_3").attr('name', 'gf_ellie');
    });
    </script>
    Posted 12 years ago on Monday December 12, 2011 | Permalink
  5. Thanks!! That inserted the name. I need to wrestle with the other script now - it tries to execute before the NAME is inserted - but I can contact their support for that. Thank you so much!

    Posted 12 years ago on Tuesday December 13, 2011 | Permalink
  6. Glad to help. Closing this topic. Feel free to post a new topic if further issues arise. :)

    Posted 12 years ago on Friday January 6, 2012 | Permalink

This topic has been resolved and has been closed to new replies.