OSDN Git Service

modified comments
[opengatem/opengatem.git] / html / editstring.js
1 // Module to modify the fields of device name and mail address\r
2 // used in macupdate.html in lang(ja/en) directory\r
3 \r
4 // get string of clicked field and insert edited string\r
5 function editstring(macAddress, strType, thisItem){\r
6 \r
7     newStr = prompt("Edit "+strType, thisItem.innerHTML);\r
8     if (newStr != null){\r
9         thisItem.innerHTML=newStr;\r
10         insertHiddenInput(macAddress, strType+" "+newStr);\r
11     }\r
12 }\r
13 \r
14 // insert hidden input field for saving the edited string\r
15 // this string is sent at clicking the submit button\r
16 function insertHiddenInput(hname, hvalue){\r
17 \r
18     var parent, hiddenInput;\r
19     parent = document.getElementById('hidden');\r
20     hiddenInput = document.createElement('input');\r
21     hiddenInput.type = 'hidden';\r
22     hiddenInput.name = hname;\r
23     hiddenInput.value = hvalue;\r
24     parent.appendChild(hiddenInput);\r
25 }\r