Sha256: e6d745a454a0c29b5fb12fbb63edb4ffcee2454fad0232dba322dd637c5baba6
Contents?: true
Size: 693 Bytes
Versions: 393
Compression:
Stored size: 693 Bytes
Contents
<form id="example-form-validation" action="" method="get"> <%= pb_rails("phone_number_input", props: { error: "Missing phone number.", id: "validation", initial_country: "af", value: "", required: true }) %> <%= pb_rails("button", props: {html_type: "submit", text: "Save Phone Number"}) %> </form> <% content_for(:pb_js) do %> <%= javascript_tag do %> document.addEventListener('DOMContentLoaded', function () { document.querySelector('#example-form-validation').addEventListener('submit', function (e) { if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) e.preventDefault(); }) }) <% end %> <% end %>
Version data entries
393 entries across 393 versions & 2 rubygems