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.

Setting the name of an input text field

  1. I'm trying to figure out if there's a way to set the name of an input text field to a fixed name. I'm trying to populate that field with input from another form (hopefully a lightbox form). Something like:
    <input type="text" name="monogram" value="" />

    If the target field changes every time I add another field, then it will be a real pain to change everything if I add more fields later. Also tryint to figure out how to add a tag so that the value field gets populated on the submit of the other form (or lightbox form). In php, if the field being passed is called monogram, then it would be:

    <input type="text" name="monogram" value="<?php echo $_POST['monogram']; ?>" />

    Thanks,
    Alisa

    Posted 11 years ago on Tuesday June 26, 2012 | Permalink
  2. David Peralty

    You can set fields to be populated dynamically and then set a parameter name. This should let you do something like:

    site.com/?parametername=value and have the value populate the field you allowed to be populated dynamically using whatever parameter name you typed in.

    Posted 11 years ago on Tuesday June 26, 2012 | Permalink
  3. I had already done all these thing before I submitted the question.

    If I understand what you're saying, I should set the method to "get" and the action set to "http://website.com/folder/" in my second form. Then when the user hits submit on the 2nd form, the value should go right into the field.

    When I do a view source, I see that field is called input_21? This is what I see:

    [html]
    <label class='gfield_label' for='input_1_21'>Monogram</label>
    <div class='ginput_container'>
    <input name='input_21' id='input_1_21' type='text' value='' class='medium'  tabindex='5'   />
    </div>

    If you say it will work, I'll give it a try, but I don't see how it can.

    Thanks,
    Alisa

    Posted 11 years ago on Tuesday June 26, 2012 | Permalink
  4. David Peralty

    If you've set a parameter name, and you use get, then it should fill the field that has that parameter.

    Posted 11 years ago on Tuesday June 26, 2012 | Permalink
  5. It isn't working for me. I've even cleared my cache to make sure it isn't caching my page. Not only does it not put the value in the target field, it clears my entire form out. Maybe I need to pass everything that could possibly be set into my popup form and send it back out again. all I know is that I can get this working manually. By this I mean outside of wordpress, hand coding both target/base page and pop-up page.

    I bet if I pass all the already set variable into my pop-up form, using the name fields that Gravity Form assigns instead of what I put in the parameter field, then it will work. I was just hoping for a slicker solution.

    Thanks,
    Alisa

    Posted 11 years ago on Wednesday June 27, 2012 | Permalink
  6. David Peralty

    Can you link to your forms? The URL to fill out a form field would be something like:
    http://test.com/page/?parametername=value
    You have to use GET methods and not POST methods.

    Posted 11 years ago on Wednesday June 27, 2012 | Permalink
  7. Main form is at http://dancingbayembroidery.com/koozies/. Scroll down to Text and select Monogram. When you do that, a link will pop up to the right of the Text drop down box. Click on that link and that is the 2nd form. The url for that form is http://dancingbayembroidery.com/popups/monograms.php which was created by hand not not through wordpress or gravity forms. I would like to have created it with WP/gravity forms, but I cannot figure out how to get the images to show up or how to get a page with no theme headers or footers or sidebars. I want this to open in a lightbox, but have not figured out how to do that yet.

    Posted 11 years ago on Wednesday June 27, 2012 | Permalink