質問編集履歴
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,9 +30,9 @@
|
|
30
30
|
//ラジオボタン
|
31
31
|
if($col['answer'.$j]){
|
32
32
|
if($col['required'.$k]){
|
33
|
-
echo"<input required type='radio' name='question{$question_count}
|
33
|
+
echo"<input required type='radio' name='question{$question_count}' value='".$col['answer'.$j]."'>".$col['answer'.$j].'<br>';
|
34
34
|
}else{
|
35
|
-
echo"<input type='radio' name='question{$question_count}
|
35
|
+
echo"<input type='radio' name='question{$question_count}' value='".$col['answer'.$j]."'>".$col['answer'.$j].'<br>';
|
36
36
|
}
|
37
37
|
}
|
38
38
|
}elseif($col['format']==$frmtC){
|
@@ -50,9 +50,9 @@
|
|
50
50
|
//テキストボックス
|
51
51
|
if($col['answer'.$j]){
|
52
52
|
if($col['required'.$k]){
|
53
|
-
echo"<input required type='text' name='question{$question_count}
|
53
|
+
echo"<input required type='text' name='question{$question_count}' value=''>".$col['answer'.$j].'<br>';
|
54
54
|
}else{
|
55
|
-
echo"<input type='text' name='question{$question_count}
|
55
|
+
echo"<input type='text' name='question{$question_count}' value=''>".$col['answer'.$j].'<br>';
|
56
56
|
}
|
57
57
|
}
|
58
58
|
}
|
@@ -61,7 +61,7 @@
|
|
61
61
|
|
62
62
|
//その他
|
63
63
|
if($col['other'.$k]){
|
64
|
-
echo $col['other'.$k]."<input type='text' name='question{$question_count}
|
64
|
+
echo $col['other'.$k]."<input type='text' name='question{$question_count}' id='question{$question_count}' value=''>";
|
65
65
|
}
|
66
66
|
echo "<input type='hidden' name='question_id' value='".$col['questionnaires_id']."'>";
|
67
67
|
}
|
@@ -75,4 +75,60 @@
|
|
75
75
|
|
76
76
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
77
77
|
PHPのバージョンは5.3.1です。
|
78
|
-
エディタはサクラエディタを利用しています。
|
78
|
+
エディタはサクラエディタを利用しています。
|
79
|
+
|
80
|
+
###追記
|
81
|
+
```HTML
|
82
|
+
<!DOCTYPE HTML>
|
83
|
+
<html>
|
84
|
+
<head>
|
85
|
+
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" ;/>
|
86
|
+
<link href="css/questionStyle.css" type="text/css" rel="stylesheet">
|
87
|
+
<title>アンケート</title>
|
88
|
+
|
89
|
+
<script>
|
90
|
+
$(document).ready(function(){
|
91
|
+
$("#form").validate({
|
92
|
+
rules:{
|
93
|
+
'#checkBtn': {required: true}
|
94
|
+
},
|
95
|
+
messages :{
|
96
|
+
'#checkBtn':{required: "1つ以上選択してください"}
|
97
|
+
},
|
98
|
+
errorPlacement :function(error,element){
|
99
|
+
if (element.attr("id") == "#checkBtn" ) error.insertAfter("#error");
|
100
|
+
else (element.attr("id") == "id" ) error.insertAfter(element);
|
101
|
+
}
|
102
|
+
});
|
103
|
+
});
|
104
|
+
</script>
|
105
|
+
|
106
|
+
</head>
|
107
|
+
<body>
|
108
|
+
|
109
|
+
<form action ="send.php" method="post" id="form">
|
110
|
+
<h1 align="center">あんけえと</h1>
|
111
|
+
<hr>
|
112
|
+
<div class="question" align="center">
|
113
|
+
<p>Q1.くえすちょん</p>
|
114
|
+
<p align="left" style="display:inline-block;">
|
115
|
+
<input type='checkbox' name='question1[]' value='いち' id='required'>いち<br>
|
116
|
+
<input type='checkbox' name='question1[]' value='に' id='required'>に<br>
|
117
|
+
<input type='checkbox' name='question1[]' value='さん' id='required'>さん<br>
|
118
|
+
<input type='checkbox' name='question1[]' value='よん' id='required'>よん<br>
|
119
|
+
<input type='checkbox' name='question1[]' value='ご' id='required'>ご<br>
|
120
|
+
<input type='hidden' name='question_id' value='1'>
|
121
|
+
</p>
|
122
|
+
</div>
|
123
|
+
<div align="right">
|
124
|
+
<input type="submit" value="送信する" id="send" class="send" name="send" style="width:100px; height:30px;">
|
125
|
+
</div>
|
126
|
+
</form>
|
127
|
+
<div id="error">
|
128
|
+
</div>
|
129
|
+
</body>
|
130
|
+
</html>
|
131
|
+
```
|
132
|
+
> 質問はHTMLベースでおこなってください。
|
133
|
+
|
134
|
+
PHPをブラウザで開き、ソースをコピーしてみたのですが、このような感じであっていますでしょうか?
|