My Name is Kay....

DIY , 먹방 , 개발 , 육아 , 여행 좋아합니다.
AdBlock 사용시 화면이 정상적으로 노출되지 않습니다.
포스팅 관련 문의 및 개발 문의는 Email : wkzkfmxksi@gmail.com

추가 포스팅이 이뤄지지 않는 블로그입니다. 문의는 wkzkfmxksi@gmail.com 으로 연락주세요.
kay
조회 수 2897 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

상황 : 

아무리 들여다 보아도 분명 폼으로 쌓여있는 것이 분명한데 값을 가져오지 못하는 상황이었습니다. 


원인 : 

간소화해보면 아래와 같은 html 페이지가 있을때

div 태그의 위치가 맞지 않게 되면 jQuery에선 해당 input의 값을 가져오지 못합니다..

해당 폼의 html 값을 찍어보고 나서야 이해했습니다. 


( 전혀 예상치 못했습니다..;; html 페이지 라인의 압박으로.. 차마 보지 못했던.. 사실은 엉성한 html 들여쓰기의 문제도 있었지요.. )



test Url : http://www.uhoon.co.kr/test/1219.html


<!DOCTYPE html>
<html>
<head>
	<title>test</title>
	<script src="http://code.jquery.com/jquery-latest.min.js"></script>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8">
</head>
<script type="text/javascript">
<!--
	$(function() {
		$("#btn").on("click",function(){
			alert($("form[name='frmA'] input[name='inputAA']").val());
			alert($("form[name='frmA']").html());
		});
	});
//-->
</script>
<body >
<div>
<form name="frmA" >
<input type="text" name="inputA" />
<input type="text" name="inputB" />
</div>
<input type="text" name="inputC" />
<div>
	<input type="text" name="inputD" />
</div>
<input type="text" name="inputAA" />
<input type="text" name="inputBB" />
<input type="text" name="inputCC" />
<input type="text" name="inputDD" />
<div>
</form>
</div>
<input type="button" id="btn" value="폼 확인" />
</body>
</html>
?

  1. 라이브러리가 등록 되지 않았습니다. (HRESULT에서 예외: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

    Date2014.01.06 CategoryMSSQL Bykay Views4954
    Read More
  2. The page you are looking for is temporarily unavailable. Please try again later.

    Date2014.05.22 CategoryEtc Bykay Views4543
    Read More
  3. 일괄 처리를 실행하는 동안 오류가 발생했습니다. 오류 메시지: multipart 이름이 잘못되어 SQL Server 결과를 처리하지 못했습니다. "192.168.0.33.디비명.dbo.테이블명", 현재 한도 "4"이(가) 부족합니다.

    Date2014.05.20 CategoryMSSQL Bykay Views4187
    Read More
  4. 'TRUNCATE_ONLY'은(는) 인식할 수 없는 BACKUP 옵션입니다.

    Date2013.11.04 CategoryMSSQL Bykay Views3989
    Read More
  5. HTTP 오류 메시지

    Date2013.03.11 CategoryHTTP Bykay Views3833
    Read More
  6. BULK INSERT 행 x, 열 xx (column name)에 대량 로드 데이터 변환 오류(잘림)가 발생했습니다.

    Date2017.04.05 CategoryMSSQL Bykay Views3713
    Read More
  7. The configuration file now needs a secret passphrase (blowfish_secret).

    Date2013.04.24 CategoryMYSQL Bykay Views3697
    Read More
  8. Notice: Undefined index: 변수명.

    Date2013.06.30 CategoryPHP Bykay Views3421
    Read More
  9. 컴퓨터에 MSVCR110.dll이(가) 없어 프로그램을 시작할 수 없습니다. 프로그램을 다시 설치하여 이 문제를 해결하십시오.

    Date2014.07.14 CategoryPHP Bykay Views3360
    Read More
  10. jQuery 로 폼안의 객체를 가져오지 못하는 경우

    Date2013.11.20 CategoryJavascript Bykay Views2897
    Read More
  11. DEXTUpload 오류 '800a004b' Path/File access error

    Date2014.05.15 CategoryEtc Bykay Views2432
    Read More
  12. Login failed for user 'userid'. (Microsoft SQL Server, Error : 18456)

    Date2015.08.19 CategoryMSSQL Bykay Views1219
    Read More
  13. Deprecated: Function split() is deprecated

    Date2014.12.19 CategoryPHP Bykay Views1094
    Read More
  14. mysqldump: Got error: 1016: Can't open file: '.\xxx\xxx.frm' (errno: 24 ) when using LOCK TABLES

    Date2015.08.28 CategoryMYSQL Bykay Views1021
    Read More
Board Pagination Prev 1 2 Next
/ 2