-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddress.js
53 lines (53 loc) · 3.22 KB
/
address.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function newaddress() {
var myID = newID();
var newRoot = newDiv("address_" + myID + "_editor", "address_editor");
newRoot.appendChild(newInput("", "", "hidden", "editobj_address_" + myID, "true"));
newRoot.appendChild(document.createTextNode(" "));
newRoot.appendChild(newInput("", "", "hidden", "address_" + myID + "_ca", currentCA));
newRoot.appendChild(document.createTextNode(" "));
var newNode = newRoot.appendChild(newSection("description", "Description"));
newNode.appendChild(newInput("", "description", "text", "address_" + myID + "_description", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("straddr", "Street Address"));
newNode.appendChild(newInput("", "addr1", "text", "address_" + myID + "_addr1", ""));
newNode.appendChild(document.createTextNode(" "));
newNode.appendChild(newInput("", "addr2", "text", "address_" + myID + "_addr2", ""));
newNode.appendChild(document.createTextNode(" "));
newNode.appendChild(newInput("", "addr3", "text", "address_" + myID + "_addr3", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("city", "City"));
newNode.appendChild(newInput("", "city", "text", "address_" + myID + "_city", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("state", "State"));
newNode.appendChild(newInput("", "state", "text", "address_" + myID + "_state", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("zip", "Postal Code"));
newNode.appendChild(newInput("", "zip", "text", "address_" + myID + "_zip", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("country", "Country"));
newNode.appendChild(newInput("", "country", "text", "address_" + myID + "_country", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("validfrom", "Valid From"));
newNode.appendChild(newInput("", "validfrom", "text", "address_" + myID + "_validfrom", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("validto", "Valid To"));
newNode.appendChild(newInput("", "validto", "text", "address_" + myID + "_validto", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("lastcheck", "Last Verified"));
setDateBox(newNode.appendChild(newInput("", "lastcheck", "text", "address_" + myID + "_lastcheck", "")));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("valid", "Valid"));
newNode2 = newInput("", "valid", "checkbox", "address_" + myID + "_valid", "");
newNode2.checked = true;
newNode.appendChild(newNode2);
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("mailing", "Mailing Address"));
newNode2 = newInput("", "mailing", "checkbox", "address_" + myID + "_mailing", "");
var oc = document.createAttribute("onchange");
oc.value = "mailAddr(" + "'address_" + myID + "_mailing'" + ")";
newNode2.attributes.setNamedItem(oc);
newNode.appendChild(newNode2);
newNode.appendChild(document.createTextNode(" "));
newRoot.appendChild(document.createTextNode(" "));
return newRoot;
}