<commit_before>## CN1ML Sample: A Contact Form

[Return to Samples](../../README.md#more-samples)

This sample is part of the [CN1MLDemos](../../CN1MLDemos) project.  It demonstrates how to create a simple contact form using CN1ML. It uses a combination of layouts, including a table for arranging the labels and fields of the form.

### CN1ML Source:
From [ContactForm.cn1ml](../../CN1MLDemos/src/ca/weblite/codename1/cn1ml/demos/ContactForm.cn1ml)

~~~
<html>
    <head></head>
    <body layout="y">
        <script>
            self.setScrollableY(true);
        </script>
        <label uiid="Title">Contact Details</label><commit_msg>Added some comments to the ContactForm example.<commit_after>## CN1ML Sample: A Contact Form

[Return to Samples](../../README.md#more-samples)

This sample is part of the [CN1MLDemos](../../CN1MLDemos) project.  It demonstrates how to create a simple contact form using CN1ML. It uses a combination of layouts, including a table for arranging the labels and fields of the form.

####Some things to Notice:

1. The `<body>` tag uses the shortcut `y` for the layout which CN1ML will automatically change to BoxLayout.Y_AXIS.
2. The `<body>` tag also includes a `<script>` tag where some extra custom initialization is done.  In this case we make the root container scrollable.  Note that inside `<script>` tags, "self" always reference to the Component that corresponds to the `<script>` tag's immediate parent.


### CN1ML Source:
From [ContactForm.cn1ml](../../CN1MLDemos/src/ca/weblite/codename1/cn1ml/demos/ContactForm.cn1ml)

~~~
<html>
    <head></head>
    <body layout="y">
        <script>
            self.setScrollableY(true);
        </script>
        <label uiid="Title">Contact Details</label>
{'fraction_non_alphanumeric': 0.12320916905444126, 'fraction_numerical': 0.013180515759312322, 'mean_word_length': 3.619047619047619, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4794060', 'n_tokens_mistral': 545, 'n_tokens_neox': 519, 'n_words': 191}