Small Snap! Logo Snap! Websites

Work in progress
Snap! C++

Incredible Websites for Incredible People

Snap! Form Country Component

Creating a Country Component

The (Small Snap! Logo) Snap! Form feature is useful to create a form that your visitors fill up with information that you can then access in your website submissions and receive in an email.

When you want to ask the user to enter the name of their country, you can offer a freestyle text field. The problem with those is that people can enter anything they want...

Another way is to create a Select widget and enter the list of countries you accept. When the list of countries is limited, this is acceptable. If you want to accept all the countries in the world, however, that's about 240 names!

To help you with that, we offer the complete list of countries in a text file.

Creating the widget

Go to your (Small Snap! Logo) Snap! Form and click on Edit.

Once the editor appears, you have a new tab at the top Form components, click on it.

Adding new component

New component sample.This gives you the list of existing components. At the bottom of the list, you can notice a text field, a drop-down, check boxes and the Add button. Enter Country in the text field and Select in the drop-down. Mark the field mandatory and to be sent by email depending on your needs.

Setting up component options

Component form.Once you clicked on Add, you reach the component form. Here, you can enter the name of the component, its default value, and for a select the list of accepted value which is what will appear in your drop-down widget.

As you can see in our screenshot on the right side, we entered Country as the field name and United States as the default value.

Then the Options field includes all the options that appear in our drop-down. In our case, those are the country names as found in the list of countries.

Make the widget a drop-down box

Mark the widget as a list.Finally, lower in this form, you want to check the Select list box as shown on the figure. Otherwise, you will get a very long list of radio buttons (the default with the Select type.)

Don't forget to Save. Then move the the component to the place where you want it to be and save again.

You are done.

AttachmentSize
countries.txt2.61 KB
Snap! SEO e-Book Index: