card
card copied to clipboard
Card can't find a nameInput in your form
I am using jquery.card.js with wordpress. I have configured the checkout form fields correctly. I don't have a input with Card Holder Name in the payment form (It is not required in my case). I am getting this error "Card can't find a nameInput in your form" in jquery.card.js. Is it possible to use the js without the Name field.
@mangya Please show some code. We cannot help much with diagnosis of what's going on. I'll have to check on whether the name is required.
@BallisticPain Here is the code for your reference.
$("form.checkout").card({
form: "form",
container: '.festi-wizard-step-payment .card-wrapper',
formSelectors: {
numberInput: 'input#s4wc-card-number',
expiryInput: 'input#s4wc-card-expiry',
cvcInput: 'input#s4wc-card-cvc',
nameInput: 'input#s4wc-card-name'
},
width: 200, // optional — default 350px
formatting: true, // optional - default true
// Strings for translation - optional
messages: {
validDate: 'valid\ndate', // optional - default 'valid\nthru'
monthYear: 'mm/yyyy', // optional - default 'month/year'
},
// Default placeholders for rendered fields - optional
placeholders: {
number: '•••• •••• •••• ••••',
name: 'Full Name',
expiry: '••/••',
cvc: '•••'
},
// if true, will log helpful messages for setting up Card
debug: true // optional - default false
});
I'm just guessing here, but couldnt you just add a <input type="hidden" name="nameInput" value=""> in your form tag? Not sure if it will work but worth a shot...