This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Address Field Names above fields


  1. Dazmond
    Member

    Hi There,

    Is it possible to have the field names for the address section to be above the fields rather than below?

    Some users are becoming confused with the postcode section and entering information required in the field above instead.

    I've seen a fix for this in the forums but the post is 2 years old, it no longer works as I assume the code has changed a lot since then?

    Many thanks,

    Darren.

    Posted 11 years ago #
  2. DaveVoss
    Member

    Yes, I agree that that would be nice. I don't know why it seems confusing with the labels below. I guess it's becuase alll the other fields have their labels above.

    Posted 11 years ago #
  3. Dazmond
    Member

    Here is the reply I received from tech support, may be of use:

    You can edit "includes/view-functions.php" file for this.
    Go to around line 3348 ~ 3386 and you will see this code :

    $element_markup = <<<EOT
    <li id="li_{$element->id}" {$li_class}>
    <label class="description">{$element->title} {$span_required}</label>
    
    <div>
    <span id="li_{$element->id}_span_1">
    <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text large" value="{$default_value_1}" type="text" />
    <label for="element_{$element->id}_1">{$mf_lang['address_street']}</label>
    </span>
    
    <span id="li_{$element->id}_span_2" {$address_line2_style}>
    <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text lar ge" value="{$default_value_2}" type="text" />
    <label for="element_{$element->id}_2">{$mf_lang['address_street2']}</label>
    </span>
    
    <span id="li_{$element->id}_span_3" class="left state_list">
    <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text large" value="{$default_value_3}" type="text" />
    <label for="element_{$element->id}_3">{$mf_lang['address_city']}</label>
    </span>
    
    <span id="li_{$element->id}_span_4" class="right state_list">
    {$state_markup}
    <label for="element_{$element->id}_4">{$mf_lang['address_state']}</label>
    </span>
    
    <span id="li_{$element->id}_span_5" class="left">
    <input id="element_{$element->id}_5" name="element_{$element->id}_5" class="element text large" maxlength="15" value="{$default_value_5}" type="text" />
    <label for="element_{$element->id}_5">{$mf_lang['address_zip']}</label>
    </span>
    
    <span id="li_{$element->id}_span_6" class="right">
    <select class="element select large" id="element_{$element->id}_6" name="element_{$element->id}_6">
    {$country_markup}
    </select>
    <label for="element_{$element->id}_6">{$mf_lang['address_country']}</label>
    </span>
    </div>{$guidelines} {$error_message}
           </li>
    EOT;

    Then change <label> tag position to be above <input> tag.

    Posted 11 years ago #
  4. adrearubin
    Member

    Awesome! Thanks Dazmond. This worked for me. In v4.5 my code started @ 3944 - 3983.

    Definitely looks a lot better and people are less confused about it.

    Posted 9 years ago #

RSS feed for this topic

Reply