-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_script.js
44 lines (36 loc) · 1.12 KB
/
ui_script.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
/* ui_script.js
POSTフォームの追加を行う
*/
// フォームの個数
var form_count = 0;
/* フォームの追加 */
function Add(){
form_count++;
form_count_str = String(form_count);
// フォームの追加
var div_element = document.createElement("div");
div_element.innerHTML = "<p>post" + form_count_str + "(key,value)</p>"
+ "<form name=\"post" + form_count_str + "_form\">"
+ " <input type=\"text\" name=\"key\">"
+ " <input type=\"text\" name=\"value\">"
+ "</form>";
var parent_object = document.getElementById("post_form");
parent_object.appendChild(div_element);
}
/* --- Formからのデータの受け取り --- */
function getForms(){
//result
var names_array = [""];
var values_array = [""];
//URL
var url = url_form.textbox.value;
// add script
for (var count=1 ; count<=form_count ; count++){
var get_form_script = " names_array.push(post"+ count + "_form.key.value);"
+ " values_array.push(post" + count + "_form.value.value);";
eval(get_form_script);
}
names_array.shift();
values_array.shift();
return [url,names_array,values_array];
}