card icon indicating copy to clipboard operation
card copied to clipboard

Card can't find a nameInput in your form

Open mangya opened this issue 8 years ago • 3 comments

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 avatar May 12 '17 14:05 mangya

@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 avatar May 18 '17 04:05 BallisticPain

@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
	});

mangya avatar May 18 '17 06:05 mangya

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...

RickKukiela avatar Jun 26 '17 23:06 RickKukiela