(일반적으로 작동하는 것처럼) 호버에 jQuery qtip을로드하고 있습니다. 이 qtip 안에는 텍스트 상자와 버튼이 있습니다. 이 버튼을 클릭하면이 텍스트 상자의 값으로 무엇인가를하고 싶습니다. 어떻게 든 jQuery의 .val() 함수는 텍스트 상자의 초기 값을 반환합니다. 내가 어디로 잘못 가고 있니?jQuery에서 작동하지 않는 qtip 내의 텍스트 상자 값 읽기
jQuery 코드 : 팝업 qtip에 대한
$(function() {
$("#someplace").qtip({
content: $("#popup"),
hide: {
fixed: true
},
position: {
corner: {
tooltip: 'topMiddle',
target: 'bottomMiddle'
},
adjust: {
x:-30,
y:-75
}
},
style: {
width:'100px',
color:'white',
name:'tspopup'
}
});
$("#button_in_the_qtip").click(
function() {
var txt = $("#textbox_in_the_qtip").val();
alert($("#textbox_in_the_qtip").attr('id')); // This returns "textbox_in_the_qtip"
alert(txt); // This returns "abc" <---- Problem
}
);
});
HTML 코드 :
<div style="display:none;" id="popup">
<table cellpadding="5px" border="1" style="margin-top:12px; margin-bottom:12px; color:#fff; font-size:.7em;">
<tr>
<td>
<input type="text" id="textbox_in_the_qtip" value="abc" />
</td>
<td>
<button id="button_in_the_qtip">Add</button>
</td>
</tr>
</table>
</div>
1.4.2를 사용했지만 1.3.2로 전환했지만 시도했지만 코드가 작동하지 않습니다. 변경 했습니까? –
흠, 재밌 네요. 정교화 주셔서 감사하지만 onContentUpdate 내에서 버튼 클릭 정의를 입력하면 클릭 핸들러가 등록 (첨부)되지 않습니다! 경고는 작동하지 않습니다. –
아, 걱정마. 나는 일할 수있어! 고마워, 윌! :) –