Appnitro Software Forums » MachForm

Populating State Field

(4 posts)
  • Started 2 years ago by MarioCipriano
  • Latest reply from redityo

  1. I would like to pre-populate the state field.

    Posted 2 years ago #
  2. How you will populate the field ? is it by your form url? for exmaple when a user access the form with this url :

    http://www.yourdomain.com/machform/view.php?id=2&state=ABC

    then state field would be filled with "ABC". If so, you can try to use the method that posted in here :

    http://www.appnitro.com/forums/topic/dynamic-content-php?replies=25#post-4445

    Posted 2 years ago #
  3. No, I am would like to set it in the HTML code or using CSS. I am not attempting to fill the field via the URL. I would also like to remove country.

    Posted 2 years ago #
  4. I see, you can set the default value for "state" field by editing "includes/view-functions.php" file. Go to around line 1383 for this code :

    foreach ($country as $data){

    then put this code exactly above that line

    $element->populated_value['element_'.$element->id.'_4']['default_value'] = "state";

    and to remove "country" field, you can simply hide it by CSS, try to put these CSS code in your form :

    #li_4_div_6 {
    display:none !important;
    }

    in there I assume your address field id is 4, you need to change those ID with yours.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.