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.

Put form entry URL into form field

  1. I need to put the admin side URL to a form entry into a form. I know that in the Notifications section you can specify that URL be sent in the notification email, but I'd like to insert it into a field on the form. I don't think this is possible to do as a dynamic variable since there is no entry until the form is submitted, but even if it gets added to the form after submission that's fine.

    I've done some changing of form fields/labels after submission before, but I was wondering where I can grab the URL that the Notifications section uses.

    I want the URL in the form so it can be included in exports.

    Thanks!

    Posted 12 years ago on Wednesday September 26, 2012 | Permalink
  2. Which URL do you want to include in the form? The edit link for the entry, so that will be included in entry exports?

    Posted 12 years ago on Wednesday September 26, 2012 | Permalink
  3. I want the URL that leads directly to the single Entry view for that particular entry on the admin side, so it would look like:
    http://www.website.com/wp-admin/admin.php?page=gf_entries&view=entry&id=9&lid=390&filter=&paged=3&pos=42

    I believe the merge tag {entry_url} that's available in the Notifications area gets what I need.

    Posted 12 years ago on Thursday September 27, 2012 | Permalink
  4. Any info you can give me?

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  5. I don't believe there is a way to include the edit URL in the form before the form is submitted. You said "but even if it gets added to the form after submission that's fine." but did you mean added to the entry, which would be emailed to the admin, or do you really mean the form?

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  6. I want the URL inserted into the Entry. I know that it's included in admin email, but we want it also stuck in the form so it can be exported and printed out, or just copied/pasted into other internal forms.

    -Sorry, I'm trying to convey something that I don't quite feel is absolutely necessary myself. A client's request. The only situation in which it makes much sense is to have this URL available for exporting with an entry.

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  7. Got it now; thanks for that explanation. You will have to update the entry using the gform_after_submission hook, after it is created, since you won't have the entry ID until that point.

    Add a hidden field to your form; call it "Edit Link" and give it visibility for the admin only (so it does not show to the visitor.) Then, add this code to your theme's functions.php: http://pastebin.com/Bqvh8J8F

    You will need to change the 12 on line four to your form ID, and the 6 on line nine to the ID of your hidden field. You will also need to edit the website URL on line twelve to your actual URL.

    That code worked for me to include the edit URL in the entry. It's not hyperlinked, it's just plain text. My copy of Open Office automatically hyperlinks URLs like that, or if you are copying and pasting, this should be all you need.

    Let us know if you need additional assistance.

    Posted 12 years ago on Wednesday October 3, 2012 | Permalink
  8. worked great! thank you!

    Posted 12 years ago on Tuesday October 9, 2012 | Permalink
  9. Thank you for the update.

    Posted 12 years ago on Wednesday October 10, 2012 | Permalink

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