N
N
Nikolai2018-08-13 17:06:15
1C-Bitrix
Nikolai, 2018-08-13 17:06:15

How to style input in Bitrix web form?

I have a web form template

<div class="modal-content modal-content--form-auth"> 	 
  <div class="modal-header"> 
    <h5 class="modal-title" id="exampleModalLabel"><?=$FORM->ShowFormTitle("")?></h5>
   </div>
  <div class="modal-body">
  	<div class="form-group">
      <label for="InputName">Ваше имя</label>
      <?=$FORM->ShowInput('new_field_27640')?>
    </div>
    <div class="form-group">
      <label for="InputEmail">Ваша почта</label>
      <?=$FORM->ShowInput('new_field_4185')?>
    </div>
    <div class="form-group">
      <label for="exampleFormControlTextarea1">Ваше сообщение</label>
      <?=$FORM->ShowInput('new_field_93532')?>
    </div>
    
    <?=$FORM->ShowInput('new_field_5697')?>
   </div>
  <div class="modal-footer">
  	<?=$FORM->ShowSubmitButton("","")?>
 </div>
</div>

How to style the given output <?=$FORM->ShowInput('new_field_27640')?> . Or is it possible to add classes only through js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Skibin, 2018-08-13
@nikolay_akhmetyanov

Use "Use the default form template" and resolve it all through the template, and do not store this case in the database. There, respectively, $arResult['QUESTIONS'] will be available to you, from which you can build whatever you want. If you just add attributes to the input, then add the necessary attributes in the response settings and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question