Skip to content

Commit

Permalink
Merge pull request canonical#13962 from mtruj013/hiddenInput-forms
Browse files Browse the repository at this point in the history
Fix missing phone field on marketo submission
  • Loading branch information
mtruj013 authored Jun 19, 2024
2 parents 9ce39d3 + a1a635e commit bb62a53
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions static/js/src/prepare-form-inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ function preFormatCountry(countryCode, countryInput) {
* @param {HTMLElement} phoneInput - The input element for the phone number.
*/
export function setupIntlTelInput(countryCode, phoneInput) {
phoneInput.removeAttribute("name"); // Ensure only the hidden input is submitted.

intlTelInput(phoneInput, {
utilsScript: "/static/js/dist/utils.js",
separateDialCode: true,
hiddenInput: phoneInput.name,
initialCountry: countryCode,
});

phoneInput.removeAttribute("name"); // Ensure only the hidden input is submitted.
addInputValidation(phoneInput);
}

Expand Down

0 comments on commit bb62a53

Please sign in to comment.