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.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
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)
Dieses Thema enthält 8 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von michaelS-13 vor 5 Jahre, 1 Monat.
Assistiert von: Shane.