我用的是
jquery-1.3.1.min.js
jquery.jmodal.js
模拟出一个对话框,
但是不知道里面元素的值如何获取代码:
$().ready(function() {
$('#NewAlbum').click(function() {
$.fn.jmodal({
data:{innertext:document.getElementById("txtalbum").value},
title: '新建相册',
content: $('#AddAlbumDialog').html(),
buttonText: { ok: '确定', cancel: '取消' },
okEvent: function(obj, args) {
alert(obj.innertext);
alert(document.getElementById('aspnetForm').txtalbum.value);
//document.getElementById('aspnetForm').submit();
}
});
});
})
<!--新建相册对话框-->
<div id="AddAlbumDialog" style="display:none;">
<table>
<tr><td>输入相册名:</td></tr>
<tr><td><input type="text" id="txtalbum" name="txtalbum" /></td></tr>
<tr><td><input type="radio" checked="checked" id="AlbumtypePrivate" name="Albumtype"/> 私有相册,只有你分享的好友才能查看</td></tr>
<tr><td><input type="radio" name="Albumtype" id="AlbumtypePublic" /> 共有相册,任何人都可以看</td></tr>
</table>
<input type="hidden" name="test" id="test" value="dddd" />
</div><!--end新建相册对话框-->现在就想获得id为txtalbum的value值
jquery-1.3.1.min.js
jquery.jmodal.js
模拟出一个对话框,
但是不知道里面元素的值如何获取代码:
$().ready(function() {
$('#NewAlbum').click(function() {
$.fn.jmodal({
data:{innertext:document.getElementById("txtalbum").value},
title: '新建相册',
content: $('#AddAlbumDialog').html(),
buttonText: { ok: '确定', cancel: '取消' },
okEvent: function(obj, args) {
alert(obj.innertext);
alert(document.getElementById('aspnetForm').txtalbum.value);
//document.getElementById('aspnetForm').submit();
}
});
});
})
<!--新建相册对话框-->
<div id="AddAlbumDialog" style="display:none;">
<table>
<tr><td>输入相册名:</td></tr>
<tr><td><input type="text" id="txtalbum" name="txtalbum" /></td></tr>
<tr><td><input type="radio" checked="checked" id="AlbumtypePrivate" name="Albumtype"/> 私有相册,只有你分享的好友才能查看</td></tr>
<tr><td><input type="radio" name="Albumtype" id="AlbumtypePublic" /> 共有相册,任何人都可以看</td></tr>
</table>
<input type="hidden" name="test" id="test" value="dddd" />
</div><!--end新建相册对话框-->现在就想获得id为txtalbum的value值
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货