Sha256: c84ed5ab790aa569d804de6ed2de994c5adac3c4bb3bab5e99b4d2c3519c7fc5

Contents?: true

Size: 1.84 KB

Versions: 1

Compression:

Stored size: 1.84 KB

Contents

<div class="full_contact_form">

  <%= form_for :cmessage,
               :url => '/callback_message',
               :remote => true,
               html: {
                       :role => :form,
                       :id => 'form_callback', #-> callback_message.js.erb uses this ID
                       :data => {
                               :model => 'cmessage'
                       }
               } do |f| %>

      <div class="form-group">
        <%= f.label :name, 'Ваше имя', class: 'control-label' %>
        <%= f.text_field :name,
                         :class => 'form-control',
                         :maxlength => 30
        %>
        <span class="help-block col-md-12"></span>
      </div>

      <div class="form-group">
        <%= f.label :mobile, 'Номер телефона', class: 'control-label' %>
        <%= f.text_field :mobile,
                         :class => 'form-control',
                         :maxlength => 30
        %>
        <span class="help-block col-md-12"></span>
      </div>

      <div class="form-group kapcha">
        <%= f.text_field :kapcha, class: 'form-control', :maxlength => 30 %>
      </div>

      <div class="actions">
        <%= f.submit 'Перезвоните мне',
                     class: 'btn btn-primary',
                     data: {
                             disable_with: 'Отправляется...'
                     }
        %>
      </div>

  <% end %>

  <script>
      $(document).ready(function(){

          var $form = $("form#form_callback");

          $form.bind("ajax:error",function(event, data, status, xhr){
              $form.render_form_errors( $.parseJSON(data.responseText) );
          });

          $form.modal_success();

          $form.find("input").each(function() {
              $(this).blur();
          })

      });
  </script>

</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
c80_callback-0.1.0.2 app/views/c80_callback/shared/inner/forms/_full_contact_form.html.erb