<%= form_with(model: vendor, local: true, html: { class: 'needs-validation', novalidate: true }) do |form| %> <% if vendor.errors.any? %> <% end %>
<%= form.label :name, class: 'form-label' %> <%= form.text_field :name, class: 'form-control' %>
<%= form.label :address, class: 'form-label' %> <%= form.text_area :address, rows: 1, class: 'form-control auto-expand' %>
<%= form.label :phone, class: 'form-label' %> <%= form.telephone_field :phone, id: 'phone-field', class: 'form-control', placeholder: '(XXX)-XX-XXXX' %>
<%= form.label :email, class: 'form-label' %> <%= form.email_field :email, id: 'email-field', class: 'form-control', required: true, placeholder: 'Make sure to include @ sign' %>
<%= form.label :dba, 'DBA', class: 'form-label' %> <%= form.text_field :dba, class: 'form-control', placeholder: 'Doing Business As Name' %>
<%= form.label :tin, 'TIN', class: 'form-label' %> <%= form.text_field :tin, id: 'tin-field', class: 'form-control', maxlength: 10, placeholder: 'XX-XXXXXXX' %>
<%= form.label :contact, class: 'form-label' %> <%= form.text_field :contact, class: 'form-control', placeholder: 'Enter Contact Person here' %>
<%= form.submit class: 'btn btn-primary' %>
<% end %> <%# This is to correct phone number entry %> <%# This is for auto resizing the address field %> <%# This is to format the TIN correctly %>