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

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Re-order name fields


  1. arimage
    Member

    Is there any easy way to reverse the name field order - i.e. Last-First instead of First-Last?

    Posted 8 years ago #
  2. yuniar

    The easiest way, you can edit "includes/language.php" file, search around line 208 for this code:

    $languages['name_first']			= 'First';
    $languages['name_middle']			= 'Middle';
    $languages['name_last']				= 'Last';
    $languages['name_title']			= 'Title';
    $languages['name_suffix']			= 'Suffix';

    change it to become:

    $languages['name_first']			= 'Last';
    $languages['name_middle']			= 'Middle';
    $languages['name_last']				= 'First';
    $languages['name_title']			= 'Title';
    $languages['name_suffix']			= 'Suffix';

    MachForm Founder

    Posted 8 years ago #
  3. arimage
    Member

    Thank you. This re-orders the field on the published form (but not on the edit form panel)
    Can you tell me where to change the name field widths please? I found lines around line 362 in view.css which shows first/middle 23% and last 30% but changing here seems to make no difference.

    Thanks

    Posted 8 years ago #
  4. redityo

    The field re-orders only can be applied on published forms indeed.
    And to change name field width, you need to edit include/view-functions.php file. Go to line 2260 and you will see these codes :

    $element_markup = <<<EOT
    		<li id="li_{$element->id}" {$li_style} {$li_class}>
    		<span class="description">{$element->title} {$span_required}</span>
    		<span class="simple_name_1">
    			<input id="element_{$element->id}_1" name="element_{$element->id}_1" {$attr_readonly} type="text" class="element text" maxlength="255" size="8" value="{$default_value_1}" />
    			<label for="element_{$element->id}_1">{$mf_lang['name_first']}</label>
    		</span>
    		<span class="simple_name_2">
    			<input id="element_{$element->id}_2" name="element_{$element->id}_2" {$attr_readonly} type="text" class="element text" maxlength="255" size="14" value="{$default_value_2}" />
    			<label for="element_{$element->id}_2">{$mf_lang['name_last']}</label>
    		</span>{$guidelines} {$error_message}
    		</li>
    EOT;

    Then you can change the "size" value on those fields.


    MachForm Support

    Posted 8 years ago #

RSS feed for this topic

Reply