How do I change order of the fields within the Address field?

  • erikalvhede
    Asked on October 17, 2019 at 8:52 AM

    Hi!

    How do I change the order of sub lables?

    I want to change the adress fields.

    Right now it is: 
    Street
    City
    Postal number

    I want it to be:
    Street
    Postal number
    City

    I know you can change the name of the fields but then it will be wrong when users for example use "auto-fill".

    Thanks!

  • David JotForm Support Manager
    Replied on October 17, 2019 at 10:42 AM

    It is not possible through the form builder to switch their position, but we can do it through CSS code injection. Please try injecting this code: https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    /*Switch city and postal number fields position*/

    #id_5 .form-address-table tr:nth-of-type(3){

        position: absolute !important;

        margin-top: 10% !important;

    }

    #id_17{

        margin-top: 8% !important;

    }

    /*mobile view*/

    @media only screen and (max-width: 480px) {

    #id_5 .form-address-table tr:nth-of-type(3) {

        position: absolute !important;

        margin-top: 20% !important;

    }

    #id_17 {

        margin-top: 15% !important;

    }

    }

    /*End*/

    Result:

    Desktop view:

    1571323359desktop Screenshot 10

    Mobile view:

    1571323289result 001 Screenshot 21

    Let us know if you need more help, we will be glad to assist you.

  • erikalvhede
    Replied on October 17, 2019 at 10:47 AM

    Thanks that worked.

    But now the input field for city became smaller:

    How do I change order of the fields within the Address field? Image 10

    How do i make it so it is equal big?

  • David JotForm Support Manager
    Replied on October 17, 2019 at 11:29 AM

    Please try injecting this code also: http://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    .form-address-table td .form-sub-label-container {

        width: 400px !important;

    }

    @media only screen and (max-width: 480px) {

    .form-address-table td .form-sub-label-container {

        width: 100% !important;

    }


    }

    Result:

    1571326156result 002 Screenshot 10

    Let us know if you need more help.

  • erikalvhede
    Replied on October 18, 2019 at 3:41 AM

    Thanks that solved it. But it look strange on mobile:

    How do I change order of the fields within the Address field? Image 10

  • jherwin
    Replied on October 18, 2019 at 6:26 AM

    Hello,

    I updated the CSS code for your, can you please check and see if the issue persists on your end?

  • erikalvhede
    Replied on October 18, 2019 at 7:44 AM

    Now it look strange on desktop:

    How do I change order of the fields within the Address field? Image 10

  • Richie JotForm Support
    Replied on October 18, 2019 at 8:25 AM

    Can you please share more information on how would you like your form to look or what fields would you like to change the order or fonts?

    Do you want to remove the gap between the address field and phone field?

    How do I change order of the fields within the Address field? Image 1 Screenshot 20

    Looking forward for your response.

  • erikalvhede
    Replied on October 18, 2019 at 8:28 AM

    I want to move up the city-field:

    How do I change order of the fields within the Address field? Image 10

  • jherwin
    Replied on October 18, 2019 at 8:57 AM

    I updated your CSS code and removed the unnecessary codes, can you please check your web page again and see if it now meets your requirements?

    If you want to see the codes, you can see the copy here: https://pastebin.com/raw/v6rP231P

  • erikalvhede
    Replied on October 18, 2019 at 9:01 AM

    thank you! now it looks great. Really nice support. 

  • erikalvhede
    Replied on November 19, 2019 at 8:04 AM

    Hi again!

    When error states are shown the form dont show as intended:


    How do I change order of the fields within the Address field? Image 10

  • Richie JotForm Support
    Replied on November 19, 2019 at 8:26 AM

    I have checked your form and it seems to be working correctly at my end.

    How do I change order of the fields within the Address field? Image 1 Screenshot 20

    Can you please test your form again and let us know if the issue still remains?

  • erikalvhede
    Replied on November 19, 2019 at 8:27 AM

    Yes I have fixed on desktop. But it looks strange at mobile:

    How do I change order of the fields within the Address field? Image 10

  • Richie JotForm Support
    Replied on November 19, 2019 at 8:41 AM

    You may try this custom CSS

    @media screen and (max-width: 480px) {
    #input_5_city{
    margin-top: 40px !important;
    }
    }

    Guide:https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    If the field is not yet aligned correctly, way we know the mobile device you're using to view the form?

    Let us know how it goes.

  • erikalvhede
    Replied on November 19, 2019 at 8:51 AM

    Now it works on mobile. But look strange on 600px width:

    How do I change order of the fields within the Address field? Image 10

  • Richie JotForm Support
    Replied on November 19, 2019 at 9:21 AM

    Can  you please try this custom CSS

    @media screen and (max-width: 600px) {
    #input_5_city{
        margin-top: 20px;
    }
    }

    Guide:https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes


  • erikalvhede
    Replied on November 19, 2019 at 9:26 AM

    Thanks now it works!