0

I am having trouble disabling Chrome's payment method dropdown that is supposed to appear when you click in the credit card field but it is appearing when you click in a subject input field. Please note, the HTML is generated automatically and cannot be edited directly, I will need to adjust using JS.

    <form>
        <div id="subject_row" class="form-row form-text eCardFields show">

            <div class="form-content">
                <span class="field-required"></span>
                <label for="ecard_subjectname">Subject: *</label>

                <input type="text" name="ecard_subjectname" id="ecard_subjectname" value="" maxlength="50" placeholder="disabled only for this component">

                <input type="hidden" name="ecard_subjectsubmit" id="ecard_subjectsubmit" value="true">

            </div>
        </div>
    </form>

This is what I have tried:

//attempt 1
$('#ecard_subjectname').attr('autocomplete', 'new-password');
//attempt 2
$('#ecard_subjectname').attr('autocomplete', 'off');

enter image description here

Jenny
  • 781
  • 1
  • 9
  • 24
  • It's probably triggering off of "card" in "ecard". Not sure what you can do about that if your backend is expecting that name in its processing... Maybe change it onload and change it back onsubmit? – Heretic Monkey Jun 03 '19 at 17:27
  • Duplicate of https://stackoverflow.com/questions/39937170/prevent-chrome-from-autofilling-creditcard-info? Have you tried that solution yet or no? – Levi Blodgett Jun 03 '19 at 17:48
  • @LeviBlodgett tried that solution as well, but it doesn't work. – Jenny Jun 03 '19 at 17:51

1 Answers1

1

Try using terrylinooo's disableAutoFill for jQuery: https://github.com/terrylinooo/jquery.disableAutoFill

Levi Blodgett
  • 354
  • 1
  • 3
  • 16