Смена номера поля сообщения в рельсах 5 - PullRequest
0 голосов
/ 26 марта 2019
<div class="col-sm-8">
  <%= form.number_field :program_registration_cost, required: true, id: 'program_registration_cost', class: "form-control", step: "any" %>
</div>

Я использую поле number_field для стоимости регистрации программы, и оно показывает сообщение по умолчанию. Пожалуйста, введите число, когда я наведите курсор на него. Я хочу изменить это сообщение.

<div class="col-sm-8">
 <%= form.number_field :program_registration_cost, required: true, id: 'program_registration_cost', class: "form-control", step: "any" oninvalid: "this.setCustomValidity('Please don't put $ in front of amount')" oninput: "setCustomValidity('')" %>
</div>

Это то, что я пытался, но это не работает. Пожалуйста, помогите мне, как мне этого добиться.

enter image description here

1 Ответ

0 голосов
/ 26 марта 2019
<div class="col-sm-8">
 <%= form.number_field :program_registration_cost,:title => "Only enter numbers - do not use a $ sign.", required: true, id: 'program_registration_cost', class: "form-control", step: "any" %>
</div>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...