Notice
Recent Posts
Recent Comments
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
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
Archives
Today
In Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

A Joyful AI Research Journey๐ŸŒณ๐Ÿ˜Š

[16, 17] 230328, 230329 ๊ฐœ์ธ ํ”„๋กœ์ ํŠธ (1) 16์ผ, 17์ผ ์ฐจ Tue, Wed) ๋ฉ”์ธ ํ™”๋ฉด ์ง„ํ–‰ ์ค‘ (7) ๋กœ๊ทธ์ธ, ํšŒ์› ๊ฐ€์ž… ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ, ์•ฝ๊ด€ ์„ ํƒ ์ฒดํฌ ๋ณธ๋ฌธ

๐Ÿ’–My Bootcamp Projects Logsโœจ/Individual project 1๏ธโƒฃ

[16, 17] 230328, 230329 ๊ฐœ์ธ ํ”„๋กœ์ ํŠธ (1) 16์ผ, 17์ผ ์ฐจ Tue, Wed) ๋ฉ”์ธ ํ™”๋ฉด ์ง„ํ–‰ ์ค‘ (7) ๋กœ๊ทธ์ธ, ํšŒ์› ๊ฐ€์ž… ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ, ์•ฝ๊ด€ ์„ ํƒ ์ฒดํฌ

yjyuwisely 2023. 3. 28. 10:36

230328 Tue, 230329 Wed

๊ธฐ๋ณธํ‹€์€ ์•„๋ž˜์™€ ๊ฐ™๊ณ 
input์— name, type, id ๋“ฑ ๋‹ค์–‘ํ•œ ๊ฑธ ๋„ฃ์„ ์ˆ˜ ์žˆ๋‹ค.

๊ฒ€์ƒ‰ํ•˜๋ฉด ๋ณดํ†ต ์ „์ฒด ์•ฝ๊ด€ ๋™์˜๋งŒ ๋– ์„œ ๊ทธ๋Ÿฐ๋ฐ
์„ ํƒ ์•ฝ๊ด€ ์ฝ”๋“œ๋„ ๋„ฃ์—ˆ๋‹ค.

<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.3.min.js"></script><!-- jQuery ๋ถˆ๋Ÿฌ์˜จ๋‹ค -->

์ฝ”๋“œ) ์ „์ฒด ์•ฝ๊ด€, ์„ ํƒ ์•ฝ๊ด€, ์ด๋ฉ”์ผ, SMS ๊ฐ ๋ˆŒ๋ €์„ ๋•Œ ์ฒดํฌ๋ฐ•์Šค ์ฒดํฌ๋˜๊ฒŒ ๋งŒ๋“ค๊ธฐ

//์ „์ฒด ์•ฝ๊ด€ ๋™์˜
function checkAll() {
    if ($("#TermsOfService").is(':checked')) {
        $("input[name=sub_TermsOfServiceRequired]").prop("checked", true);
    } else {
        $("input[type=checkbox]").prop("checked", false);
    }
}

//์„ ํƒ ์•ฝ๊ด€ ๋™์˜
function checkOptional() {
    if ($("#TermsOfServiceOptional").is(':checked')) {
        $("input[name=sub_TermsOfServiceOptional]").prop("checked", true);
    } else {
        $("input[type=checkbox]").prop("checked", false);
    }
}

//์ด๋ฉ”์ผ ์ˆ˜์‹  ์ฒดํฌ์‹œ '(์„ ํƒ) ๋งˆ์ผ€ํŒ… ์ •๋ณด ์ˆ˜์‹  ๋™์˜' ๋™์˜ 
function checkOptionalEmail() {
    if ($("#sub_TermsOfService6").is(':checked')) {
        $("input[id=sub_TermsOfService5]").prop("checked", true);
    } else {
        $("input[type=checkbox]").prop("checked", false);
    }
}

//SNS ์ˆ˜์‹  ์ฒดํฌ์‹œ '(์„ ํƒ) ๋งˆ์ผ€ํŒ… ์ •๋ณด ์ˆ˜์‹  ๋™์˜' ๋™์˜ 
function checkOptionalSms() {
    if ($("#sub_TermsOfService7").is(':checked')) {
        $("input[id=sub_TermsOfService5]").prop("checked", true);
    } else {
        $("input[type=checkbox]").prop("checked", false);
    }
}

๊ฒฐ๊ณผ) ์ง„ํ–‰์ค‘์ธ ๊ฐœ์ธ ํ”„๋กœ์ ํŠธ์˜ ์ด๋ฏธ์ง€๋ฅผ ๊ฐ€์ ธ์™”๋‹ค.

ํ•„์ˆ˜ ์•ฝ๊ด€ ์ „์ฒด ๋™์˜ ๋ˆŒ๋ €์„ ๋•Œ
์„ ํƒ ์•ฝ๊ด€ ์ „์ฒด ๋™์˜ ๋ˆŒ๋ €์„ ๋•Œ
์ด๋ฉ”์ผ ๋ˆŒ๋ €์„ ๋•Œ
SMS ๋ˆŒ๋ €์„ ๋•Œ

 


https://www.ybtour.co.kr/accounts/signIn.yb?channelCode=011

๋กœ๊ทธ์ธ

https://www.ybtour.co.kr/accounts/join.yb

ํšŒ์›๊ฐ€์ž…

์†Œ์Šค ๋ณด๊ธฐ!


์ฐธ๊ณ ํ•˜๊ธฐ

https://smujihoon.tistory.com/82

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>practice Select All</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.3.min.js"></script>
<script>
function cAll() {
    if ($("#checkAll").is(':checked')) {
        $("input[type=checkbox]").prop("checked", true);
    } else {
        $("input[type=checkbox]").prop("checked", false);
    }
}
</script>
</head>

<body>
<table border="1" align="center">
                <tr>
                    <th><input type="checkbox" id="checkAll" onclick="cAll();"><label for="c0">์ „์ฒด์•ฝ๊ด€๋™์˜
                </tr>
                <tr>
                    <th><input type="checkbox" id="c1" required><label for="c1">์ด์šฉ์•ฝ๊ด€(ํ•„์ˆ˜)...
                            target="_blank">์•ฝ๊ด€์ •๋ณด</a><br>
                        <input type="checkbox" id="c2" required><label for="c2">๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ ๋™์˜(ํ•„์ˆ˜)...
                            target="_blank">์•ฝ๊ด€์ •๋ณด</a><br>
                        <input type="checkbox" id="c3" required><label for="c3">๊ฐœ์ธ์ •๋ณด ์ œ3์ž ์ œ๊ณต ๋™์˜...
                            target="_blank">์•ฝ๊ด€์ •๋ณด</a><br>
                        <input type="checkbox" id="c4"><label for="c4">์ด๋ฒคํŠธํ˜œํƒ ์•Œ๋ฆผ ์ˆ˜์‹ ๋™์˜(์„ ํƒ)...
                </tr>
            </table><br>
</body>
</html>

์ฐธ๊ณ 

https://openlife.tistory.com/381


https://www.ybtour.co.kr/accounts/join.yb

์•ฝ๊ด€ ์„ ํƒ ์ฝ”๋“œ

<div class="agree_block">
					<span class="chk_box inline"><input type="checkbox" id="esschk" name="esschk"><label for="esschk"><span></span><strong class="emp_black">(ํ•„์ˆ˜)์•ฝ๊ด€ ์ „์ฒด ๋™์˜</strong></label></span>
					<span class="chk_box inline"><input type="checkbox" id="selchk" name="selchk"><label for="selchk"><span></span><strong class="emp_black">(์„ ํƒ)์•ฝ๊ด€ ์ „์ฒด ๋™์˜</strong></label></span>
					<div class="box_line">
						<ul class="list_basic" id="esschklist">
							<li>
								<span class="inner_block">
									<span class="chk_box"><input type="checkbox" id="agreeUse" name="agreeUse"><label for="agreeUse"><span></span>(ํ•„์ˆ˜) ๋…ธ๋ž‘ํ’์„  ์ด์šฉ์•ฝ๊ด€ ๋™์˜</label></span>
									<span class="btn_right">(<a href="/static/views/CS/memberJoinTerms.html#tab1" class="link" target="_blank">๋‚ด์šฉ๋ณด๊ธฐ</a>)</span>
								</span>
							</li>
							<li><span class="chk_box"><input type="checkbox" id="agreeTng" name="agreeTng"><label for="agreeTng"><span></span>(ํ•„์ˆ˜) ๋งŒ14์„ธ ์ด์ƒ ํ™•์ธ</label></span></li>
							<li>
								<span class="inner_block">
									<span class="chk_box"><input type="checkbox" id="agreeSav" name="agreeSav"><label for="agreeSav"><span></span>(ํ•„์ˆ˜) ๊ฐœ์ธ์ •๋ณด ์ˆ˜์ง‘ ๋ฐ ์ด์šฉ ๋™์˜</label></span>
									<span class="btn_right">(<a href="/static/views/CS/memberJoinTerms.html#tab2" class="link" target="_blank">๋‚ด์šฉ๋ณด๊ธฐ</a>)</span>
								</span>
							</li>
						</ul>					
						<ul class="list_basic" id="selchklist">
							<li>
								<span class="inner_block">
									<span class="chk_box"><input type="checkbox" id="agreeSavChoice" name="agreeSavChoice"><label for="agreeSavChoice"><span></span>(์„ ํƒ) ๊ฐœ์ธ์ •๋ณด ์ˆ˜์ง‘ ๋ฐ ์ด์šฉ ๋™์˜</label></span>
									<span class="btn_right">(<a href="/static/views/CS/memberJoinTerms.html#tab3" class="link" target="_blank">๋‚ด์šฉ๋ณด๊ธฐ</a>)</span>
								</span>
							</li>
							<li><span class="chk_box"><input type="checkbox" id="agreeMkt" name="agreeMkt"><label for="agreeMkt"><span></span>(์„ ํƒ) ๋งˆ์ผ€ํŒ… ์ •๋ณด ์ˆ˜์‹  ๋™์˜</label></span>
								<span class="chk_box inline pdl mgt"><input type="checkbox" id="emailRcp" name="emailRcp"><label for="emailRcp"><span></span>์ด๋ฉ”์ผ</label></span>
								<span class="chk_box inline mgt"><input type="checkbox" id="mobileRcp" name="mobileRcp"><label for="mobileRcp"><span></span>SMS</label></span>
							</li>
						</ul>
					</div>
				</div>

์•ฝ๊ด€ ์„ ํƒ ์ œ์ด์ฟผ๋ฆฌ

	$('#esschk, #selchk').on('click', function(){	//์ „์ฒด๋™์˜
		var id =   $(this).prop('id');
		var list = id+'list';
		var divi = $('#'+id).is(':checked');
		$('#'+list+' > li').each(function(idx,itm){
			$(itm).find('input[type=checkbox]').prop('checked', divi);
		});
	});
	
	$('#esschklist input[type=checkbox]').on('click', function(){
		var total = $('#esschklist input[type=checkbox]').length;
		var chked = $('#esschklist input[type=checkbox]:checked').length;
		var divi = (total == chked);
		$('#esschk').prop('checked', divi);
	});
	
	$('#selchklist input[type=checkbox]').on('click', function(){
		var id = $(this).prop('id');
		if(id === 'agreeSavChoice' || id === 'agreeMkt') {		//(์„ ํƒ)๊ฐœ์ธ์ •๋ณด ๋™์˜์‹œ ๋งˆ์ผ€ํŒ…,์ด๋ฉ”์ผ,SMS ์ฒดํฌ
			var divi =$(this).is(':checked');
			$('#selchklist input[type=checkbox]').each(function(idx,itm){
				if(id === 'agreeMkt' && divi == false && itm.id ==='agreeSavChoice'){
					$(itm).prop('checked', true);
				} else {
					$(itm).prop('checked', divi);
				}
			});
		}
		if(id === 'emailRcp' || id === 'mobileRcp'){
			if(!$('#emailRcp').is(':checked') && !$('#mobileRcp').is(':checked')) $('#agreeMkt').prop('checked', false);
			if( $('#emailRcp').is(':checked') ||  $('#mobileRcp').is(':checked')) $('#agreeMkt, #agreeSavChoice').prop('checked', true);
		}
		var total = $('#selchklist input[type=checkbox]').length;
		var chked = $('#selchklist input[type=checkbox]:checked').length;
		var divi = (total == chked);
		$('#selchk').prop('checked', divi);
	});

728x90
๋ฐ˜์‘ํ˜•
Comments