use Mkto setValues instead of setting 'value'
This commit is contained in:
parent
dc2226bcdd
commit
6a0f231d1f
@ -4,14 +4,14 @@
|
||||
iframeHolderDiv = document.createElement('div'), // so we can style location of button
|
||||
autoFillLocation = document.querySelector("form[id^='mktoForm_']"), // will only find first Marketo form on a page
|
||||
firstRow = document.querySelector('form .mktoFormRow'),
|
||||
hiddenLinkedInInputs = document.createDocumentFragment(), // since we're creating multiple nodes, just do the add once
|
||||
hiddenLinkedInInputs = document.createDocumentFragment(), // since we're creating multiple nodes, just do the add once
|
||||
hiddenInputCreator = function (tagName, onChangeHandler) {
|
||||
var newInput = document.createElement('input');
|
||||
newInput.style.position = 'absolute';
|
||||
newInput.style.left = '-999em';
|
||||
newInput.setAttribute('name', tagName + '-flag');
|
||||
newInput.setAttribute('type', 'text');
|
||||
newInput.setAttribute('id', tagName + '-flag');
|
||||
newInput.setAttribute('id', tagName + '-flag');
|
||||
newInput.style.display = 'none';
|
||||
newInput._value = newInput.value;
|
||||
Object.defineProperty(newInput, "value", {
|
||||
@ -259,9 +259,12 @@
|
||||
ZM: 'Zambia',
|
||||
ZW: 'Zimbabwe',
|
||||
},
|
||||
country = document.querySelector("#Country");
|
||||
mktoCountryInput = document.querySelector("#Country");
|
||||
// sets the value in the form the user can see
|
||||
country.value = countries[newValue.toUpperCase()];
|
||||
if (typeof MktoForms2 !== 'undefined') {
|
||||
MktoForms2.allForms()[0].setValues({
|
||||
'Country': countries[newValue.toUpperCase()]});
|
||||
}
|
||||
});
|
||||
|
||||
/*['email', 'country'].forEach(function(inputField){
|
||||
@ -344,4 +347,4 @@
|
||||
<!-- what LinkedIn recommends which doesn't allow any customization -->
|
||||
<!--<script type="IN/Form2" data-form="mktoForm_1248" data-field-firstname="FirstName"
|
||||
data-field-lastname="LastName" data-field-phone="Phone" data-field-company="Company"
|
||||
data-field-title="Title"></script>-->
|
||||
data-field-title="Title"></script>-->
|
Loading…
Reference in New Issue
Block a user