JS Problems; Works in Chrome Debugger

txseo

Client
Регистрация
31.05.2013
Сообщения
23
Благодарностей
0
Баллы
1
I am trying to iterate thru arrays and fill out form fields but it doesnt seem to work in ZP. Are functions in the JS window out of the question in ZP?

function setCom(){
CommPref = JSON.parse('{-Variable.myXML_userInfo-}');

if(CommPref['Tele'] == 'on'){
theEle = document.getElementById("contact_phone_ok");
theEle.checked = true;
theEle.style.border = '1px red dotted';

theEle = document.getElementById("contact_phone");
theEle.value= CommPref['phone'];
theEle.style.border = '1px red dotted';
}

if(CommPref['Text'] == 'on'){
theEle = document.getElementById("contact_text_ok");
theEle.style.border = '1px red dotted';
theEle.checked = true;

theEle = document.getElementById("contact_phone");
theEle.value= CommPref['phone'];
theEle.style.border = '1px red dotted';
}

if(CommPref['Email'] == 'on'){
theEle = document.getElementsByName("Privacy");
theEle[0].checked = true;
theEle[0].style.border = '1px red dotted';
}else{
theEle = document.getElementsByName("Privacy");
theEle[1].checked = true;
theEle[1].style.border = '1px red dotted';
}

if(CommPref['fName'] != ''){
theEle = document.getElementById("contact_name");
theEle.value = CommPref['fName'];
theEle.style.border = '1px red dotted';
}
return;
}

setCom();
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 189
Благодарностей
5 830
Баллы
113
Hello,
We need example - what page are you trying to fill in forms on?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)