We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42128
    • 30 Posts
    Dharmesh Mandaliya Reply #1, 9 years, 3 months ago
    Hello Everyone,

    First, Happy New Year to all.

    I am using [[!FormItCountryOptions? &selected=`[[!+fi.country]]`]] in my form for display all countries in selectbox.- http://prntscr.com/5mw53s

    I am using Custom table for store form data into it and i know how to stored county into custom table using formit and it's working fine for me but how can i use FormItCountryOptions in EDIT FORM?.

    Please give me answer of above question.

      Thanks & Regards,
      Dharmesh Mandaliya
      Modx Expert
      Mail : [email protected]
      Skype : dharmesh.square1
      Linkedin : http://in.linkedin.com/in/dharmeshmandaliya
      Website : http://www.squareonewebsolutions.com/modx-development.php
    • I don't understand the question. If you are using the countryoptions snippet, it generates the select for you, and the select is like any hand-coded select except for the bit about maintaining the selected status. The name of the select is the same, so you would just store its value as usual.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
      • Here's how I used it a few weeks ago with a simplecart checkout form. The submitted form will have $_POST['country'] just like any form. The placeholder is named 'fi.country' simply as a convenience for preventing any conflict with any other placeholders.
        <div>
                <label for="checkout_country">[[%simplecart.orderdetails.address.country]]: <span>*</span></label>
                <select class="select required" name="country" id="checkout_country">
                [[!FormItCountryOptions? &selected=`[[!+fi.country]]`]]
                </select>
                <label class="error">[[+fi.error.country]]</label>
            </div>
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org