This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Address
Started 14 years ago by Dronny2009 | 4 posts |
-
Can the address option be changed to a UK address ?
Posted 14 years ago # -
It's possible to remove some address item, could you tell me what is UK address format/items ?
MachForm Support
Posted 14 years ago # -
I have the similar problem. Usually I donĀ“t need the lines Adress Line 2 and state/province, moreover the problem is, that users dont fill in these fields but as they are required they will be confused.
So please how can I disable these both lines in the Adress field???
THX 4 support
Posted 14 years ago # -
To remove those sub field on all form, you can edit "view-functions.php" file. Go to around line 1401 ~ 1437 for these code :
$element_markup = <<<EOT <li id="li_{$element->id}" {$error_class}> <label class="description">{$element->title} {$span_required}</label> <div id="li_{$element->id}_div_1"> <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text large" value="{$element->populated_value['element_'.$element->id.'_1']['default_value']}" type="text" /> <label for="element_{$element->id}_1">{$lang['address_street']}</label> </div> <div id="li_{$element->id}_div_2"> <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text large" value="{$element->populated_value['element_'.$element->id.'_2']['default_value']}" type="text" /> <label for="element_{$element->id}_2">{$lang['address_street2']}</label> </div> <div id="li_{$element->id}_div_3" class="left"> <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text medium" value="{$element->populated_value['element_'.$element->id.'_3']['default_value']}" type="text" /> <label for="element_{$element->id}_3">{$lang['address_city']}</label> </div> <div id="li_{$element->id}_div_4" class="right"> <input id="element_{$element->id}_4" name="element_{$element->id}_4" class="element text medium" value="{$element->populated_value['element_'.$element->id.'_4']['default_value']}" type="text" /> <label for="element_{$element->id}_4">{$lang['address_state']}</label> </div> <div id="li_{$element->id}_div_5" class="left"> <input id="element_{$element->id}_5" name="element_{$element->id}_5" class="element text medium" maxlength="15" value="{$element->populated_value['element_'.$element->id.'_5']['default_value']}" type="text" /> <label for="element_{$element->id}_5">{$lang['address_zip']}</label> </div> <div id="li_{$element->id}_div_6" class="right"> <select class="element select medium" id="element_{$element->id}_6" name="element_{$element->id}_6"> {$country_markup} </select> <label for="element_{$element->id}_6">{$lang['address_country']}</label> </div> {$guidelines} {$error_message} </li> EOT;
then change it to
$element_markup = <<<EOT <li id="li_{$element->id}" {$error_class}> <label class="description">{$element->title} {$span_required}</label> <div id="li_{$element->id}_div_1"> <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text large" value="{$element->populated_value['element_'.$element->id.'_1']['default_value']}" type="text" /> <label for="element_{$element->id}_1">{$lang['address_street']}</label> </div> <!--<div id="li_{$element->id}_div_2"> <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text large" value="{$element->populated_value['element_'.$element->id.'_2']['default_value']}" type="text" /> <label for="element_{$element->id}_2">{$lang['address_street2']}</label> </div>--> <div id="li_{$element->id}_div_3" class="left"> <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text medium" value="{$element->populated_value['element_'.$element->id.'_3']['default_value']}" type="text" /> <label for="element_{$element->id}_3">{$lang['address_city']}</label> </div> <!--<div id="li_{$element->id}_div_4" class="right"> <input id="element_{$element->id}_4" name="element_{$element->id}_4" class="element text medium" value="{$element->populated_value['element_'.$element->id.'_4']['default_value']}" type="text" /> <label for="element_{$element->id}_4">{$lang['address_state']}</label> </div>--> <div id="li_{$element->id}_div_5" class="right"> <input id="element_{$element->id}_5" name="element_{$element->id}_5" class="element text medium" maxlength="15" value="{$element->populated_value['element_'.$element->id.'_5']['default_value']}" type="text" /> <label for="element_{$element->id}_5">{$lang['address_zip']}</label> </div> <div id="li_{$element->id}_div_6" class="left"> <select class="element select medium" id="element_{$element->id}_6" name="element_{$element->id}_6"> {$country_markup} </select> <label for="element_{$element->id}_6">{$lang['address_country']}</label> </div> {$guidelines} {$error_message} </li> EOT;
And to disable the validation on removed field, you can edit "post-function.php" file and go to line 464 for this code :
$rules[$element_name_4]['required'] = true;
then remove or comment that line
MachForm Support
Posted 14 years ago #
Reply
You must log in to post.