Problem:
The issue here is that the user had a phone number field on their form. However this field stopped working.
Solution:
Upon investigating the issue I found that the user was using some custom code to format the field into a telephone number, however the code had some issues and caused the field to stop working.
The correct code can be seen below.
document.getElementsByName('wpcf-telephone')[0].addEventListener('input', function (e) { var x = e.target.value.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,4})/); e.target.value = !x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : ''); });
To get this to work for your site just replace 'wpcf-telephone' with "wpcf-myfield" where myfield is the slug of your custom field.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 8 réponses, has 2 voix.
Last updated by michaelS-13 Il y a 4 années et 8 mois.
Assisted by: Shane.