Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.


                <div class='container'>
  <div class='row'>
     <div class='col-md-6 center-block' style='float:none'>
	<div class="panel panel-default" style='margin: 20px 0; padding:10px;'>
	   <h4>Форма<br><small>Используются компоненты: j-Textbox, j-Dropdown, j-Click, j-Error, j-Input</small></h4>
	   <div data---="textbox__form1.firstname__required:true;placeholder:Имя;icon2:pencil;error:Введите ваше имя" class='mb10'>Имя</div>
	   <div data---="textbox__form1.lastname__required:true;placeholder:Фамилия;icon:pencil;error:Введите вашу фамилию" class='mb10'>Фамилия</div>
	   <div data---="textbox__form1.secondname__placeholder:Отчество;" class='mb10'>Отчество</div>
	   <div data---="textbox__form1.db__type:number;increment:true;required:true;" class='mb10' style='width: 150px;'>Год рождения</div>
	   <div data---="radiobutton__form1.sex__items:Муж|0,Жен|1;type:number;">Ваш пол</div>
	   	   <div data---="dropdown__form1.color_id__datasource:arr_colors;text:title;value:id;type:number;">Ваш любимый цвет</div>
	   <div data---="input__form1.phone__mask:+7(###)###-####;maskregexp:null,null,null,\d,\d,\d,null,\d,\d,\d,null,\d,\d,\d,\d">Телефон</div>
	   <div data-jc="textbox" data-jc-path="" data-jc-config="placeholder:Email;icon2:envelope-o;required:true;type:email;" class='mb10'>Email</div>
	   <div data-jc="textbox" data-jc-path="form1.login" data-jc-config="placeholder:Логин;required:true;keypress:true;maxlength:20;validation:value.match(/^[0-9а-яА-Яa-zA-Z _\.(),\-]+$/)" class='mb10'>Логин</div>
           <div data---="textbox__form1.password__type:password;required:true;maxlength:20;validation:value.match(/^[0-9a-zA-Z _\.(),\-]+$/)" class='mb10'>Пароль</div>	
	   <div data---="textbox__form1.name__required:true;innerlabel:true;placeholder:Место работы;icon2:pencil;error:Введите место работы" class='mb10'>Место работы</div>
	   <div data---="textarea__form1.description__placeholder:Описание деятельности;" class='mb10'>Описание деятельности</div>
	   <div data---="checkbox__form1.agree_terms">Согласен с правилама</div>
    <div data-bind="form1.agree_terms__visible:!value">Отметьте галочкой "Согласен с правилама", иначе форма не будет сохранена</div>
	   <div data-jc="error" data-jc-path="errors1"></div>
           <div class='text-center'>
              <button data-jc="click" data-jc-path="submit1" data-loading-text="<i class='fa fa-spinner fa-spin'></i> Ждем..." class='btn btn-default btn-sm' >Сохранить 1</button> 
              <button data-bind="form1.btn__click:submit1" data-loading-text="<i class='fa fa-spinner fa-spin'></i> Ждем..." class='btn btn-default btn-sm'>Сохранить 2</button>


                body {background-color: #eee;}
.mb10 {margin-bottom: 10px;}


var form1 = {'db': 1950, 'sex': 0, 'phone':'+7(999)166-6666', };
var arr_colors = [{'id': 1, 'title': 'Красный'}, 
                  {'id': 2, 'title': 'Синий'},
                  {'id': 3, 'title': 'Зеленый'}];

function submit1(e) {
  SET('errors1', null);          
	if (form1.db<1960) SET('errors1', 'Год рождения должен быть больше 1950');
	if (!form1.agree_terms) SET('errors1', 'Вы должны согласиться с правилами');
  if (errors1) return;
	if (!VALIDATE('form1.*')) return; 
	  }, 1000)