개요

controller 에서 받기

<form>
		<input type='checkbox' name='price' value='111'/>
		<input type='checkbox' name='price' value='222'/>
		<input type='checkbox' name='price' value='333'/>
		<input type='checkbox' name='price' value='444'/>
</form>
public class PriceVO {
		private String price; // 111,222,333,444
}

JavaScript 에서 받기

<div>
		<input type='text' name='price' value='111'/>
		<input type='text' name='price' value='222'/>
		<input type='text' name='price' value='333'/>
		<input type='text' name='price' value='444'/>
		<input type="button" id="arrayButton" value="click"/>
</div>
$("#arrayButton").on("click", function() {
		// 값들의 갯수 -> 배열 길이를 지정
		var length = $("input[name=price]").length;
		// 배열 생성
		var arr = new Array(length);
		// 배열 값 입력
		for(var i = 0; i < length; i++) {
			arr[i] = $("input[name=price]").eq(i).val();
			console.log(arr[i]);
		}
})