• Resolved vkeves

    (@vkeves)


    Hello Petko,

    When calculating distance I need the initial location to be hidden. However, as soon as I hide it, calculation stops working.

    Everything works fine when the address is not hidden.

    I am using this CSS to hide calculation fields:

    input[type=”text”].wpcf7-display-none {
    display: none;
    }

Viewing 1 replies (of 1 total)
  • Plugin Author pbosakov

    (@pbosakov)

    Hello, if you need to hide the initial location, I assume that you want it to be pre-set to a fixed address that cannot be modified by the user.

    In that case, you may simply use the “hidden” field type available in Contact Form 7: https://contactform7.com/hidden-field/

    With a hard-coded field, you do not need the “_formatted” suffix mentioned in the plugin documentation.

    Here is some example code that you can adapt to your needs.

    Address 1: [hidden start "Via Appia Nuova, 1095 00178 Roma RM, Italy"]
    Address 2: [address end]
    Distance: [calculation distance2 "fn_distance(start, end_formatted, km)"]
    [calculate_button calculate]
Viewing 1 replies (of 1 total)
  • The topic ‘Address field not working when hidden’ is closed to new replies.