Home pattern regex rails text_field_tag not working
Reply: 0

pattern regex rails text_field_tag not working

user637
1#
user637 Published in May 23, 2018, 10:46 pm

I have a rails text_field_tag which i want to input a pattern to only allow numbers and allow numbers max to 100 but somehow nothing is working. I can still input characters and text

My code below

<%= text_field_tag "loan_application[kyc_answer_attributes][share_margin]", @decoded_self_evaluation.try(:loan_application).try(:kyc_answer).try(:share_margin), placeholder: 'Max 100%', class: 'text-center', pattern: '\d*[0-9]\.\d*[0-9]' %>

It looks as seen on tutorials and all but it doesnt seem to work not sure what i am missing.

Any help is greatly appreciated

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306041 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO