Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function initialize(cardForm) {
var fieldComponent;
var name = frameName.getFrameName();
var form = document.createElement('form');
form.setAttribute('novalidate', true);
form.setAttribute('action', '#'); // Forms need an action in order to offer a "go" button on soft keyboard
form.addEventListener('submit', function (event) {
event.preventDefault();
});
injectWithAllowList(
cardForm.configuration.styles,
allowedStyles
);
fieldComponent = new FieldComponent({
cardForm: cardForm,
type: name
});
form.appendChild(fieldComponent.element);
if (name === 'number') {
createInputsForAutofill(form);
}
global.bus.on(events.AUTOFILL_EXPIRATION_DATE, autofillHandler(fieldComponent));