250x250
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- php
- 애니메이션
- iPhone
- image
- ipad
- button
- react
- 비전공자
- effect
- SWIFT
- front-end
- 개발자
- Animation
- 프론트엔드
- xcode
- css3
- 백엔드
- 자바스크립트
- iOS 개발자
- jQuery
- 풀스택
- 비전공 개발자
- CSS
- keyframes
- MAC
- hover
- IOS
- HTML
- javascript
- html5
Archives
- Today
- Total
비전공자 개발일기
PHP & jQuery checkbox 활용 본문
728x90
SMALL


<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TEST</title>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4544051457126963"
crossorigin="anonymous"></script>
<!-- jquery -->
<script type="text/javascript" src="/plugin/jquery/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style>
* {
text-align: center;
}
</style>
</head>
<body>
<?php
$name= "test";
$age = 100;
$numbers = 884440;
?>
<div class="cs_load">
<label for="cs_load">정보 불러오기</label> <input type="checkbox" id="cs_load" style="display: inline;">
</div>
<input type="text" class="txtBox" name="p_name">
<input type="text" class="txtBox" name="p_jumin">
<input type="text" class="txtBox" name="p_age" numonly>
<script>
$(function() {
$("input[type='checkbox']").on("click", function() {
var chk = $(this).is(":checked");
if(chk) {
$("input[name='p_name']").val("<?=$name?>");
$("input[name='p_age']").val("<?=$age?>");
$("input[name='p_jumin']").val("<?=$numbers?>");
} else {
$("input[name='p_name']").val("");
$("input[name='p_age']").val("");
$("input[name='p_jumin']").val("");
}
})
})
</script>
</body>
</html>728x90
LIST
'PHP' 카테고리의 다른 글
| PHP with if condition (0) | 2021.12.31 |
|---|---|
| PHP with Select Option (0) | 2021.12.30 |
| PHP 5일차 (0) | 2021.12.25 |
| PHP 4일차 (배열 출력) (0) | 2021.12.23 |
| PHP 3일차 (0) | 2021.12.22 |