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. SSL/TLS 보안 채널에 대한 트러스트 관계를 설정할 수 없습니다.

  2. HTTP 오류 메시지

  3. #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

  4. Alternate HTML content should be placed here. This content requires the Adobe Flash Player. Get Flash

  5. The configuration file now needs a secret passphrase (blowfish_secret).

  6. The mysqli extension is missing. Please check your PHP configuration.

  7. waiting for code.jquery.com

  8. IISMANAGER_ERROR_LOADING_PROVIDER_TYPE

  9. Notice: Undefined index: 변수명.

  10. 사용자 'sa'이(가) 로그인하지 못했습니다. 이 사용자는 트러스트된 SQL Server 연결과 관련되어 있지 않습니다. (Microsoft SQL Server, 오류: 18452)

  11. 크로스 스레드 작업이 잘못되었습니다. 'xxx' 컨트롤이 자신이 만들어진 스레드가 아닌 스레드에서 액세스되었습니다.

  12. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\파일명 on line 9

  13. HTTP/1.1 새 세션 실패

  14. 'TRUNCATE_ONLY'은(는) 인식할 수 없는 BACKUP 옵션입니다.

  15. jQuery 로 폼안의 객체를 가져오지 못하는 경우

  16. ADODB.Connection 오류 '800a0e7a' 공급자를 찾을 수 없습니다. 올바르게 설치되지 않았을 수 있습니다. /excel.asp, 줄 16

  17. ASP 페이지를 실행하여 Response 버퍼의 구성된 제한이 초과되었습니다.

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

  19. Chrome Bug - Location.reload() 호출 시 Form 데이터가 초기화 되는 문제

  20. 문자열을 날짜 및/또는 시간으로 변환하지 못했습니다.

Board Pagination Prev 1 2 Next
/ 2