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.

Sending HTML inputs into notifications

  1. Alex
    Member

    I have made a form inclusive of a HTML block which includes some inputs I want to use to send with all the other input fields. so, for example, I have this within the HTML block:

    <input id="HouseNumber" name="HouseNumber" type="text" value="" />

    How can I include this within notifications?

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  2. You can't include inputs in the HMTL blocks and have them processed with the rest of the form, nor pass the values to the notifications. The plugin doesn't function that way.. the HTML fields are purely for adding additional markup and are ignored when the form is processed.

    Why not add a simple text field via the form builder to capture the information?

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  3. Alex
    Member

    I will give it a go. I have been using a postcode lookup system that works with the rest and has been a CSS nightmare!

    If the input is within the <form></form> then I thought it would have been able to go through. I will copy the form and see what I can do...

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  4. Alex
    Member

    how can I add other properties into the input as well as changing the id and class? eg adding:

    onchange="javascript:populateAddress();"'

    into the form editor to match this:

    <select id="qas-selector" class="ui-corner-all" onchange="javascript:populateAddress();">
    <option>Please Select</option>
    </select>

    at the moment the form is outputting this:

    <select name='input_24' id='input_3_24'  class='medium gfield_select' tabindex='7' >
    <option value='-PLEASE SELECT-' >-PLEASE SELECT-</option>
    </select>
    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  5. Alex
    Member

    i have also added this to no avail:

    <script type="text/javascript">
    	   jQuery('#input_3_24').bind('onchange', function (){
    	      javascript:populateAddress();
    	   });
    </script>
    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  6. You are going about this the wrong way.

    If you want to populate fields you need to do so either with PHP code or by passing data to an existing field via the query string. You also can't add fields to your form by any other means other than the form builder. Gravity Forms is completely dynamically driven and only processes fields it creates.

    Explain exactly what you are trying to accomplish and I can provide you with some guidance on how to do what you are trying to do.

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  7. Alex
    Member

    ok, thanks. at first i just assumed you could include an input and then call it during the notification period.

    what I want to do is populate an address via a postcode (zipcode to you) lookup database. when the person enters the postcode it generates options to select an address. once selected, the dropdown disappears and is replaced with the inputs already filled out. of course the user can also enter this manually.

    also (if you know how to do this but not 100% essential), i want the postcode to also decide which site is closest to them (in another dropdown) and give them the chance to change it if they wish.

    this all make sense? if not i can provide the full code that works

    Posted 13 years ago on Thursday December 9, 2010 | Permalink
  8. Alex
    Member

    do you need the code then?

    Posted 13 years ago on Thursday December 9, 2010 | Permalink
  9. Alex
    Member

    here is the URL of the working section of the form within a bare HTML file:
    http://www.carcraft.co.uk/info/form.html

    Hopefully this is enough to go on

    Posted 13 years ago on Friday December 10, 2010 | Permalink
  10. Alex
    Member

    anyone have any insight here?

    Posted 13 years ago on Monday December 13, 2010 | Permalink
  11. Hi Alex,

    Just getting caught up on this thread... So exactly which part of this are you running into the issue with? Populating the address inputs when the select value changes? If so, you were on the right track using jQuery to bind an action to the onchange event for the desired select field. You don't need the "javascript:" in front of the function name though; and that might be generating an error.

    <script type="text/javascript">
    	   jQuery('#input_3_24').bind('onchange', function (){
    	      populateAddress();
    	   });
    <script>

    Give that a go and let me know if you get an error. If you do, please post the exact error here.

    Thanks!

    Posted 13 years ago on Tuesday December 14, 2010 | Permalink
  12. Alex
    Member

    No it wasn't that. The link I provided above is an example of it working. now I want to put these fields into a Gravity Form (as I assumed pasting this into a HTML block would pass the varibles into the notifications) so that I can use the postcode finder within a gravity form. There is no visible option for me to edit the <input> fields to add the Javascript calls.

    Posted 13 years ago on Monday December 20, 2010 | Permalink
  13. If you want to attach an event to an input field you have to do so using jQuery and the ID of the input. There is no built in way in Gravity Forms to do this. You would have to use jQuery.

    I'm not entirely sure if you want to accomplish is possible with Gravity Forms. You can't merge your custom form code with Gravity Forms. You have to work within the boundaries of the form builder, and then enhance that using either jQuery or custom PHP using Gravity Forms API hooks.

    Posted 13 years ago on Monday December 20, 2010 | Permalink
  14. Alex
    Member

    ok. i'll have a messaround and post back here if I find a solution. thanks guys

    Posted 13 years ago on Monday December 20, 2010 | Permalink