Adding data input mask

  • channing meyer
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #150144 by channing meyer
Adding data input mask was created by channing meyer
Hi OSTeam:

I have been trying to add a data input mask in telephone field but have not had success. Added to custom script in Yootheme Page Builder.

Have tried to add to #phone using this:
$(":input").inputmask();
$("#phone").inputmask({ mask: "(999) 999-9999" });
and
$('input[name="phone-number"]').mask('(000) 000 0000');
for the "name" attribute. 
And some other options.  Is it possible or can you guide me please.
Thank you.
 

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #150153 by Mr. Dam
Replied by Mr. Dam on topic Adding data input mask
Hi,
You can open tool: "Custom Fields management" at Backend of Joom Donation, and open field: "Phone" for modifying.
In field modification form, you can enter value for "Place holder" text. Therefore, you won't need to add any CSS inputmask for that field
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • channing meyer
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #150177 by channing meyer
Replied by channing meyer on topic Adding data input mask
Thank you Dam:

I understand that.  I was hoping to get this behavior, css-tricks.com/input-masking/
By forcing a format, whether it is for credit cards, phone numbers, etc. I can make it easier for visitor and keep a uniform format. 

Thank you.

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #150190 by Mr. Dam
Replied by Mr. Dam on topic Adding data input mask
Hi,
OK, you can follow below steps to modify your donation form
1. Open file
[root] -> components -> com_jdonation -> view -> donation -> tmpl -> default.php or simpleflow_layout.php
2. Add this at top
Code:
[code]<script type='text/javascript' src="https://rawgit.com/RobinHerbots/jquery.inputmask/3.x/dist/jquery.inputmask.bundle.js"></script>

and add this at bottom of file
Code:
<script type="text/javascript">
jQuery(":input").inputmask();
</script>
[/code]
Then, you can add data-inputmask in fields in Donation form like Phone, Credit Card number
Thanks
Dam
The following user(s) said Thank You: channing meyer

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamDũng Nguyễn Việt