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

Req Change, remove and sort Address fields


  1. danyael
    Member

    Dear Yuniar,

    One last issue came up, how can I disable certain things in the address field?
    Now it is:

    Label Address:
    Street Address
    Address Line 2
    City
    Postal/Zip Code
    State
    Country

    I would like to have:

    "Street Address"
    "Postal/Zip Code" and next to it "City"
    "Country"

    How is this possible?

    Best regards, Danyael

    Posted 16 years ago #
  2. yuniar

    It is possible, by modifying the PHP file, but all your forms would have the same address fields as above.

    If that's okay for you, just contact me when you are ready.


    MachForm Founder

    Posted 16 years ago #
  3. danyael
    Member

    Hi Yuniar, I am also ready for this.

    Posted 16 years ago #
  4. yuniar

    Great, I've replied to your email. Let's continue there.


    MachForm Founder

    Posted 16 years ago #
  5. wmiletello
    Member

    I would like to make some changes to my address field as well. Please advise.

    Posted 16 years ago #
  6. yuniar

    wmiletello - I've replied your email


    MachForm Founder

    Posted 16 years ago #
  7. TTI
    Member

    Is there any way you could post how to do this?

    Thank you!

    Posted 16 years ago #
  8. yuniar

    Edit your includes/view-functions.php file.

    Replace line 1401 - 1437 with this code:
    http://mf.pastebin.com/f36db4024


    MachForm Founder

    Posted 16 years ago #
  9. target
    Member

    Link is dead, can you please repost?

    Posted 16 years ago #
  10. redityo

    Hi,

    Edit your "includes/view-functions.php" file, search around line 1418 and 1457 you'll see 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>&nbsp;{$guidelines} {$error_message}
    </li>
    EOT;

    replace with this one

    $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" style="display:none !important">
    	<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_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_3" class="right" >
    	<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"  style="display:none !important">
    	<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_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>&nbsp;{$guidelines} {$error_message}
    </li>
    EOT;

    it will show address element in this format

    [Street Address]
    [Postal/Zip Code][City]
    [Country]


    MachForm Support

    Posted 16 years ago #
  11. debaser666
    Member

    Hi- I need to change the address format to

    [City]
    [State / Province / Region]
    [Country]

    how do I do this & do you have a code?

    Thank you in advance,

    Emmet

    Posted 14 years ago #
  12. redityo

    So you no need address street at all ? if so, you can change the code to be like this :

    $element_markup = <<<EOT
    		<li id="li_{$element->id}" {$error_class}>
    		<label class="description">{$element->title} {$span_required}</label>
    
    		<div id="li_{$element->id}_div_3">
    			<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">
    			<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_6" >
    			<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>&nbsp;{$guidelines} {$error_message}
    
    		</li>
    EOT;

    MachForm Support

    Posted 14 years ago #

RSS feed for this topic

Reply