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.

Query String

  1. selym
    Member

    I'm wondering if someone can help me understand passing data via query string. I just don't get it. I've read over the wikipedia page, scoured the forums for examples, messed with the sample, but I just don't understand how to format it.

    I have it set for Redirect, checked the box for query strings, and all I want to include in the confirmation is a line of text and the url it just created the post on. I was able to accomplish this using the text option by putting {embed_url}{post_id} together (since I'm using the post_id permalink it worked perfectly). But I could not get the "Print This" plugin to print this message/url output, so I'd like to try it in a redirect. I'm just struggling with labels, values, and how to format the query string.

    Any guidance is appreciated very much.

    Thanks,
    Sel

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  2. Can you post a link to a form where you can implemented this, and a screenshot of your redirect settings with the query string visible? Sounds like you're very close to getting it working.

    Not sure about "Print This" but we can work on one thing at a time, such as getting a simple redirect with a query string parameter and value to work.

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  3. selym
    Member

    Thanks Chris. The thing is, I really don't know what to put for a query string. I've tried mimicking the sample with form fields or tried understanding the examples in various other posts, but I'm embarrassed to say I just don't quite get it. In the form below, the confirmation is set to Redirect and pass form field data is checked. All I'm hoping to return is the url of the post that was just created, which is why I used {embed_url}{post_id} in the text version I tested.

    Test Form: http://bit.ly/nNDBVA
    Redirect: http://bit.ly/nWdUaC

    In the Sample, it says phone={Phone:1}&email{Email:2}, so how would I know what to replace if I want to return the url and post id? I've tried replacing those sample fields with what I thought I needed, but without understanding it, I feel like I'm just chasing my tail.

    I'm hoping the problem I had with the "Print This Section" plugin (to be able to print the url) will work better from a redirect page rather than the text confirmation option I have set up on the root of the domain. I figure it's worth a shot.

    Thanks,
    Sel

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  4. If you want the URL to the post included in your confirmation, or your notification, you don't need to use a redirect at all. Do you want to just insert the information into either the notification, or confirmation, or do you want to redirect them there. Please post exactly what you want to do, and we will help you out.

    Couple things about your example though. That's not really a query string you built, with your two merge tags. It's just two values stuck together. And the {embed_url} is the URL where the form was embedded. That might not be what you want.

    You could probably try something like this to display the URL to the post that was just created:

    [html]
    <a href="http://www.unsecrets.com/live/?p={post_id}" rel="nofollow">This is a link to your post</a>

    Assuming live is part of the URL to your site.

    the "rel='nofollow'" stuff is added by the forum software here. You can leave that out. It's not in what I pasted in.

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  5. selym
    Member

    Sorry to be such a bother. It's not a problem with Gravity Forms at all, just my understanding of certain options.

    What I want is after someone submits a post, it will 1) display a few short words and the url of the post and 2) a print option to print just these few words and the url. I have successfully implemented the first part in the form here: http://bit.ly/n9Sd6y

    Since this print plugin I'm using is confused and will not print the short message and url like it should (despite it highlighting it in my confirmation) I am considering trying another method (redirection) in the hopes that it will work better.

    I would much rather leave the text confirmation working as is if I could print the output somehow, but none of the printing related posts I've found make sense to me. And as I understand it, there is no built-in ability to print the confirmation information.

    Thanks,
    Sel

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  6. OK, you got the first part. Can you post a link to the plugin, if it's freely available? Sounds like it just needs a little configuration to tell it what part of the page to print.

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  7. selym
    Member

    Yes sir, it's free. Thank you so much for even taking the time to look.

    http://wordpress.org/extend/plugins/wordpress-print-this-section/

    Thanks,
    Sel

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  8. I downloaded and installed that. I see how it works now. It's designed to print posts or pages, not something like this confirmation message.

    However, you could accomplish the same thing by creating a stylesheet and applying "display:none" to the items on your confirmation page that you do NOT want printed. Would that work?

    Otherwise I think we need to figure out how to wrap your confirmation message in something that tells the plugin to just print that section. What exactly do you want on your printed page? Just the yellow boxed confirmation message?

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  9. selym
    Member

    Yes, the yellow box confirmation message is all I would need printed. I saw another post mentioning the css route as well, I just wasn't sure where to start with that one.

    http://www.gravityhelp.com/forums/topic/convert-form-to-pdf-on-confirmation-page

    I'm using the Thesis theme, so maybe I'll head over to that forum and ask how I would add that kind of thing to custom.css.

    Thanks,
    Sel

    Posted 12 years ago on Friday October 21, 2011 | Permalink
  10. Looks like you figured it out by putting the print this button in the div you want printed? Did that resolve it for you, or is too much still printing?

    Posted 12 years ago on Saturday October 22, 2011 | Permalink
  11. selym
    Member

    Yep, seems like I'm just about there. The only thing I'm investigating now is how to remove the "print this" button and some other text from printing. I'm not sure if { display:none } can be used for removing such things as print buttons and specific text, or if that's used to just remove entire "sections", but I'm researching this at the moment.

    Thanks,
    Sel

    Posted 12 years ago on Monday October 24, 2011 | Permalink
  12. You can use "display:none" on nearly any element. If the button can be targeted, you can hide it with the "display:none;" CSS.

    Congratulations.

    Posted 12 years ago on Monday October 24, 2011 | Permalink
  13. selym
    Member

    Thanks Chris. I appreciate your patience and help very much.

    Thanks,
    Sel

    Posted 12 years ago on Tuesday October 25, 2011 | Permalink
  14. Is it working for you now?

    Posted 12 years ago on Tuesday October 25, 2011 | Permalink
  15. selym
    Member

    Hi Chris,

    Sadly, no, I can't figure it out. I was about to throw in the towel when I noticed you followed up to ask about it. I've used Firebug to try and isolate what I need to target, and it looks like it's gforms_confirmation_message, but removing parts of that has proved beyond me.

    I have four things in this confirmation box; 2 separate lines of text, one url, and one print button. I'd like to remove one line of text and the print button from printing, but at this point I would settle with just getting the print button out of there.

    In the Thesis forums, the last thing someone mentioned is that I could add img to the div to target the button, but anything I try has been unsuccessful so far.

    If you have any thoughts on removing just the button from that div, I'm all ears as I sit here vanquished by css. :(

    Thanks,
    Sel

    Posted 12 years ago on Wednesday October 26, 2011 | Permalink
  16. Sel, don't throw in the towel yet. Please post what you are using as your confirmation message and I will see if I can figure out what might work for you. Use pastebin.com or pastie.org to preserve the HTML and merge tags in what you paste.

    Thanks. We'll get it.

    Posted 12 years ago on Thursday October 27, 2011 | Permalink