Is it possible to change default text on address labels

  • Profile Image
    simonglenister
    Asked on November 01, 2011 at 07:23 AM

    Is there any way to change the default label text below the text entry field when using the address Quick Tool option directly within Jotform. I edited the source html, thinking this would update the labels but it didn't:

     <td><span class="form-sub-label-container"><input class="form-textbox validate[required] form-address-state" type="text" name="q29_organisationAddress[state]" id="input_29_state" size="22" />
                      <label class="form-sub-label" for="input_29_state" id="sublabel_state"> County </label></span>
                  </td>
                </tr>
                <tr>
                  <td width="50%"><span class="form-sub-label-container"><input class="form-textbox validate[required] form-address-postal" type="text" name="q29_organisationAddress[postal]" id="input_29_postal" size="10" />
                      <label class="form-sub-label" for="input_29_postal" id="sublabel_postal"> Postcode </label></span>
                  </td>

    I have a form that is UK focussed only and therefore would prefer the address label to say 'County' rather than 'State/Province' and 'Postcode' rather than 'Postal / Zip Code'.

    Many thanks

  • Profile Image
    fxr
    Answered on November 01, 2011 at 07:43 AM

    This method of altering the text of the labels can be a little buggy, as we are injecting javascript directly in to the form. 

    But it is a possible solution for you:

    Add a Free Text (HTML) field at the bottom of your form and put this code into it. 

    <script type="text/javascript">$("sublabel_postal").update("Postcode");$("sublabel_state").update("County"); </script>

    As below: 
    Click the Complete button & your should see the changes on your form.
    NOTE: Once you have put some javascript into this field, try to leave it alone i.e dont edit it. It can get buggy when being edited, so if you really do need to change something, delete the entire Free Text (HTML) field and recreate a new one.
    I tested this on a cloned version of your form & it does work. Let us know if you have any problems.
  • Profile Image
    simonglenister
    Answered on November 01, 2011 at 07:54 AM

    That worked perfectly...

    Many thanks

  • Profile Image
    flloyd2010
    Answered on September 28, 2012 at 09:04 PM

    I tried this. The html text disappears when I click on 'Complete' and I am left with a blank box.

    I don't want a full address, just City and Country.  Would appreciate any advice to make this happen.

  • Profile Image
    NeilVicente
    Answered on September 28, 2012 at 10:36 PM

    @flloyd2010

    Do you want to just change the labels of the address sub-fields, remove all the other sub-fields and leave only city and country, or do you want to do both?

    In any case, your issue looks like it needs a new separated thread. Kindly open one so we can better assist you.

    Thank you very much.

  • Profile Image
    concretepoetry
    Answered on September 25, 2014 at 05:10 PM

    Hi, is this method still working? I tried on my form and it does not seem to make a difference. Thanks!

    (for changing default text on Postal Address forms)