"HTML 라디오 버튼"의 두 판 사이의 차이

28번째 줄: 28번째 줄:
==예제==
==예제==
*http://jmnote.com/php/radio_button.php
*http://jmnote.com/php/radio_button.php
*바나나를 선택하고 [제출] 누른 경우
<source lang='text'>
Array
(
    [fruit] => banana
)
</source>


==같이 보기==
==같이 보기==

2012년 6월 21일 (목) 10:53 판

HTML 라디오 버튼

1 radio_button.php

<!DOCTYPE html>
<meta charset="utf-8" />
<title>라디오 버튼</title>
<form method='post' action='radio_button_ok.php'>
<input TYPE='radio' id='r1' name='fruit' value='apple' />
<label for='r1'>사과</label>
<input TYPE='radio' id='r2' name='fruit' value='banana' />
<label for='r2'>바나나</label>
<input TYPE='radio' id='r3' name='fruit' value='lemon' checked='checked' />
<label for='r3'>레몬</label>
<input type='submit' value='제출' />
</form>

2 radio_button_ok.php

<?php
echo '<xmp>';
print_r($_POST);
echo '</xmp>';
?>

3 예제

  • 바나나를 선택하고 [제출] 누른 경우
Array
(
    [fruit] => banana
)

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}