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

Stripping address elements out


  1. reprocessor
    Member

    Hi Yuinar,

    I was wondering how I would strip out the following fields from the address element; The fields I do not require are 'State/Province/Region' and 'Country' How would I also make the text below the 'city' field read 'town or city'? Which file and line would I find these on (I'm a bit lost!)

    Would the code allow the 'city and 'zip code' fields to sit side-by-side or would the css control that?

    Also - how can I change the size of the phone number? Your default format is (###) ###-####, I would need it to be (#####) ###### (it's for UK numbers). I'd use the international one but you would still get people putting a space between their region code and actual phone number (Which causes an error) and i'd like the form to be idiot proof if you know what I mean ;)

    Your help is always appreciated.

    Best regards,

    Phil

    Posted 16 years ago #
  2. redityo

    Hi,

    Maybe you can consider to not display country and state/provice/region section on the address field. You have to Edit your CSS and add this following code :

    I assume your address field id number is 1

    #li_1_div_4
    {
    display:none !important;
    }
    
    #li_1_div_6
    {
    display:none !important;
    }

    To change the text below the city field ,you can edit "includes/language.php" file and search around line 21 for the following line :

    $lang['address_city']		=	'City'; <-- change this one

    and for formating phone.. sorry, I'm afraid it's not possible to do so at this moment.


    MachForm Support

    Posted 16 years ago #
  3. yuniar

    Regarding phone format, we're planning to add more format for more countries.
    At this moment, only two format is available, sorry!


    MachForm Founder

    Posted 16 years ago #
  4. reprocessor
    Member

    Thanks Redityo and Yuniar,

    This solved a couple of issues.

    Cheers,

    Phil

    Posted 16 years ago #
  5. nielsenworld
    Member

    Hello!

    I did the above and removed Country/region in the address field, but it's still required!
    The customer don't see the fields now, but is not allowed to send the form because of missing required fields.

    How can that be fixed?

    BTW, thank you VERY much for a great form software, we've been searching for a long time!

    /Allan

    Posted 15 years ago #
  6. redityo

    Hi Allan,

    Above modification only works to hide the field but not disable "required" validation. To disable "required" validation to those element, you need to edit "post-functions.php" file. Go around line 465 ~ 466 you will see this code :

    $rules[$element_name_4]['required'] = true;
    $rules[$element_name_6]['required'] = true;

    add a comment to those code to be like this

    //$rules[$element_name_4]['required'] = true;
    //$rules[$element_name_6]['required'] = true;

    MachForm Support

    Posted 15 years ago #
  7. nielsenworld
    Member

    Awesome support! Thank you very much for the quick reply :-)

    /Allan

    Posted 15 years ago #

RSS feed for this topic

Reply