Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김태민
/
OpenSource_Project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
seungmi
2019-12-03 02:04:09 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
288a837a6e3ecc8e9bc168c475671b1a7dcfaebc
288a837a
1 parent
40548500
checkbox 웹페이지 양식 설정
웹페이지에서 checkbox입력을 할 수 있도록 설정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
8 deletions
views/recommendation.ejs
views/recommendation.ejs
View file @
288a837
...
...
@@ -4,7 +4,9 @@
<head>
<meta
charset=
"utf-8"
>
<link
rel=
"stylesheet"
href=
"/../style.css"
>
<title>
Test
</title>
<title>
Test
</title>
</head>
<body>
...
...
@@ -22,25 +24,55 @@
<
%= title %>
</h2>
<p>
<
%= description %>
</p>
<form
action=
'/food/recommendation'
method=
'post'
>
<button
id=
'check_all'
>
모두 선택
</button>
<button
id=
'uncheck_all'
>
모두 해제
</button>
<button
id=
'count_check'
>
체크 수 확인
</button>
<form
action=
'/food/recommendation'
method=
'post'
>
<p>
가격 :
<input
type=
"
text
"
name=
"price"
placeholder=
"price"
>
<input
type=
"
number
"
name=
"price"
placeholder=
"price"
>
</p>
<p>
형태 :
<input
type=
"text"
name=
"shape"
placeholder=
"밥, 빵, 면"
>
<input
type=
"checkbox"
name=
"shape"
value=
"밥"
>
밥
</input>
<input
type=
"checkbox"
name=
"shape"
value=
"면"
>
면
</input>
<input
type=
"checkbox"
name=
"shape"
value=
"고기"
>
고기
</input>
<input
type=
"checkbox"
name=
"shape"
value=
"기타"
>
기타
</input>
</p>
<p>
종류 :
<input
type=
"text"
name=
"kinds"
placeholder=
"한식, 중식, 일식, 양식"
>
<input
type=
"checkbox"
name=
"kinds"
value=
"한식"
>
한식
</input>
<input
type=
"checkbox"
name=
"kinds"
value=
"중식"
>
중식
</input>
<input
type=
"checkbox"
name=
"kinds"
value=
"양식"
>
양식
</input>
<input
type=
"checkbox"
name=
"kinds"
value=
"일식"
>
일식
</input>
</p>
<p>
<input
type=
"submit"
>
</p>
</form>
<script
src=
"//code.jquery.com/jquery.min.js"
></script>
<script>
$
(
"#check_all"
).
click
(
function
()
{
$
(
"input[name=kinds]:checkbox"
).
prop
(
"checked"
,
"checked"
);
});
$
(
"#uncheck_all"
).
click
(
function
()
{
$
(
"input[name=kinds]:checkbox"
).
removeProp
(
"checked"
);
});
$
(
"#count_check"
).
click
(
function
()
{
alert
(
$
(
"input[name=kinds]:checkbox:checked"
).
length
);
});
$
(
"#check_all"
).
click
(
function
()
{
$
(
"input[name=shape]:checkbox"
).
prop
(
"checked"
,
"checked"
);
});
$
(
"#uncheck_all"
).
click
(
function
()
{
$
(
"input[name=shape]:checkbox"
).
removeProp
(
"checked"
);
});
$
(
"#count_check"
).
click
(
function
()
{
alert
(
$
(
"input[name=shape]:checkbox:checked"
).
length
);
});
</script>
</article>
<
/div class="grid">
...
...
Please
register
or
login
to post a comment