답변 2개
채택된 답변
+20 포인트
2017-09-06 (수) 12:15:21
현상에 대한 자세한 내용 이라던지, 기타 오류에 관련된 내용이 전혀 없어 자세한 답변은 힘들구
아래는 간단한 예제입니다.
Copy
<?php$a = (isset($_POST['a']) === true) ? $_POST['a'] : null;if ($a !== null) { print('<pre>'); print_r($a); print('</pre>');}?><script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script><script type="text/javascript"> $(function () { $("#append").bind("click", function () { $("#tmpl").children().clone().appendTo("#frm"); }); });</script><div id="tmpl" style="display: none;"><input type="hidden" name="a[]" class="a" value="1" /></div><form id="frm" method="post" action=""><input type="button" value="append" id="append" /><input type="submit" /></form>
2017-09-06 (수) 15:33:15
전혀 안넘어온다는게 값이 아니라 배열 자체가 없는거라면
form 바깥쪽에 <input type="hidden" name="a[]" class="a" value="1" /> 가 들어가있는게 아닌가요..?
답변을 작성하려면 로그인이 필요합니다.