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

Different Country's Different Forms


  1. caseybecking
    Member

    I have multiple forms that are going to be using different country's. Is this possible. Right now i commented out any country's i didn't want people to see but this is machform wide and not specific to a form id. Any Ideas?

    Posted 15 years ago #
  2. yuniar

    This is possible by using some dynamic country removal.
    Let say you have a form with id number = 7 and you would like to remove "Zambia".

    If you checked into "includes/view-functions.php", Zambia is listed at index no. 192
    Below those country list, add this code:

    if($_REQUEST['id'] == 7){
      unset($country[192]);
    }

    Simply add another code like that if you need to do it again for another form.


    MachForm Founder

    Posted 15 years ago #
  3. rcaragao
    Member

    With your solution I can remove just one country...

    Lets say I want to see just one or 2 countries on form...in another words I want to remove almost all and leave 1 or 2.

    Is There some way?

    Posted 15 years ago #
  4. redityo

    You can do it in reverse, try to change this code with this one :

    if($_REQUEST['id'] == 3){
    	//clear all country
    	unset($country);
    
    	//select country as needed
    	$country[192]['value'] = "Zambia";
    	$country[192]['label'] = "Zambia";
    
    	$country[193]['value'] = "Zimbabwe";
    	$country[193]['label'] = "Zimbabwe";
    }

    In there I assume you'll only need Zambia and Zimbabwe country. You need to copy-paste another country code from the list in "view-functions.php" file as needed .


    MachForm Support

    Posted 15 years ago #
  5. rcaragao
    Member

    Thank you for the fast response.

    Code Worked fine.

    Thank you.

    Posted 15 years ago #

RSS feed for this topic

Reply