Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <h2>
  ご予約フォーム</h2>
お名前
<br>
<input id="gcTextBox1">
<br>
<br> メールアドレス
<br>
<input id="gcTextBox2">
<br>
<br> 電話番号
<br>
<input id="gcMask1">
<br>
<br> 住所(全角文字)
<br>
<input id="gcTextBox3">
<br>
<br> ご予約人数
<small>(1~10名)</small>
<br>
<input id="gcNumber">
              
            
!

CSS

              
                
              
            
!

JS

              
                GC.InputMan.LicenseKey = "GrapeCity-Internal-Use-Only,E533581452858357#B0T8nyd92SaOJGMJRneVdXcXRlNrMGNnxUYoRVRrlVNNZ4Y4cTRYFUWyQmYlFzQ9lkTwFHdyUFTulFM5h7NiVUMhdVVyEkckJUO4VjVyVnQ8VTQkJkUDVUaKlEUzEWOn54V5VDdxc7dyVzSn5kaOVlZ4dWN7w4VJ96V6cVVRNDeVREWEtESrhzY4MkdiBTaxYnNvlGO8AVRvYEUjZGbw8EbKBVQDVFUyp5MNpFNywka5hjTENlcGNzURlzSWRDeZRHSFRESBpVcyM4LCJUV4JmWtNnYzcDTCNjTjZDMSlHcRRTcltCbxMUZzRnUwlmI0IyUiwiIEVENBdjQEdjI0ICSiwiM4YzN9UDM7ETM0IicfJye&Qf35VfioUSLljI0IyQiwiIyYHITpEIuFWT4VHculkI0IiTis7W0ICZyBlIsIyNyEzM5ADI5ITMxkTMwIjI0ICdyNkIsIybp9ibwR6YiojIz5GRiwiI+S09ayL9Pyb9qCq9jK88GO887K88XO882O88sO88wK88iojIh94QiwSZ5JHd0ICb6VkIsIyN5MDO5gjM5QTM8UzMzUjI0ICZJJye0ICRiwiI34TQMpnaBhWSkFVOBFkSQl6Rrl6LXZ6Y534d5pXRrR4NwtEUj3GetFUWyZzSUtmNXJXV9RmaYl5cOZHeJNUOpBHbOhzLoZkRhZ6V7h5dj9ESIRnaNN6Rq3kUrsGcuZFZNhkanNDTvYnPhqW"

var gcNumber = new GC.InputMan.GcNumber(document.getElementById('gcNumber'));
gcNumber.setMinValue(1);
gcNumber.setMaxValue(10);
gcNumber.setMaxMinBehavior(GC.InputMan.MaxMinBehavior.Keep);
gcNumber.setValue(null);
var gcTextBox1 = new GC.InputMan.GcTextBox(document.getElementById('gcTextBox1'));
var gcTextBox2 = new GC.InputMan.GcTextBox(document.getElementById('gcTextBox2'));
var gcTextBox3 = new GC.InputMan.GcTextBox(document.getElementById('gcTextBox3'));
var gcMask1 = new GC.InputMan.GcMask(document.getElementById('gcMask1'));
gcMask1.setFormatPattern('\\D{2,3}\-\\D{2,4}\-\\D{4}');

var validator = new GC.InputMan.GcValidator({
    items: [
        // 正数のみ入力可
        {
            control: gcNumber,
            ruleSet: [{
                rule: GC.InputMan.ValidateType.OutOfRange,
                failMessage: '正しい人数を入力してください'
            }]
        },
        // 入力必須
        {
            control: gcTextBox1,
            ruleSet: [{
                rule: GC.InputMan.ValidateType.Required,
                failMessage: 'お名前は入力必須です'
            }],

        },
        // カスタム:メールアドレス
        {
            control: gcTextBox2,
            ruleSet: [{
                rule: function (control) {
                    var regexp = /^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/;
                    return regexp.test(control.getValue());
                },
                failMessage: '正しいメールアドレス形式で入力してください。'

            }],
            // カスタム:メールアドレス
        },

        // カスタム:住所全角文字
        {
            control: gcTextBox3,
            ruleSet: [{
                rule: function (control) {
                    var regexp = /[^\x01-\x7E\uFF65-\uFF9F]+$/;
                    return regexp.test(control.getValue());
                },
                failMessage: '住所は全角文字で入力してください。'
            }]
        }
    ],
    defaultNotify: {
        tip: true
    }
});
              
            
!
999px

Console