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

Removal of Country


  1. lif
    Member

    I did a search for this prior to posting. Is this what I need to remove to not have country show up?

    //create country markup, if no default value, provide a blank option
    if(empty($element->default_value)){
    $country_markup = '<option value="" selected="selected"></option>'."\n";
    }else{
    $country_markup = '';
    }

    foreach ($country as $data){
    if($data['value'] == $element->default_value){
    $selected = 'selected="selected"';
    }else{
    $selected = '';
    }

    Posted 15 years ago #
  2. yuniar

    Around line 1437 of your view-functions.php file, search for this code:

    <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>

    simply remove that block of code.

    Anyway, you can also set the default value of this country list, so you don't have to remove it. This way, the country dropdown will be pre-selected to the default country.


    MachForm Founder

    Posted 15 years ago #
  3. monyeenblack
    Member

    Yuniar, how can you set the default value for the country list?

    Posted 15 years ago #
  4. yuniar

    When you edit your form, click your address field.
    At the right tab, your field property, simply set the Default Country dropdown.


    MachForm Founder

    Posted 15 years ago #
  5. monyeenblack
    Member

    thank you.

    Posted 15 years ago #

RSS feed for this topic

Reply