textarea 不显示 IE 但正在提交
我在 jQuery 和 javascript 中有以下函数来创建表单元素:
createEmail: function(title){
var $emailForm = $('<form>',{action: 'sendEmail.php', id: 'emailForm'});
var $table = $('<table>');
$emailForm.append($table);
var $tr = $('<tr>');
$tr.append($('<td>',{text: 'Email From:'}));
$tr.append($('<td>',{html: '<input type="text" value="" name="from"/>'}));
$table.append($tr);
$tr = $('<tr>');
$tr.append($('<td>',{text: 'Email To:'}));
$tr.append($('<td>',{html: '<input type="text" value="" name="to"/>'}));
$table.append($tr);
$tr = $('<tr>');
$tr.append($('<td>',{text: 'Message Body:'}));
$tr.append($('<textArea>',{name: 'msg', cols: 50, rows: 10,
text: 'Attached is the ' +title+ ' license key file.\nPlease place the file in the same directory as the "check_license.php" file for ' +title+ ' '}));
$table.append($tr);
$tr.append('<input type="hidden" value="'+title+'" name="title"/>');
var $div = $('<div>').append($emailForm).dialog({
title: 'Email ' + title + ' File',
width: 600,
modal: true,
buttons: {
cancel: function(){
$(this).dialog('close');
},
send: function(){
$.post($emailForm.attr('action'), $emailForm.serialize(),function(data){
alert(data);
$div.dialog('close');
})
}
},
beforeClose: function(){
$(this).remove();
}
});
$div.dialog('widget').css('margin','0 auto');
}
由于某些原因,在 IE 中,文本区域没有显示,当您单击它时,对话框看起来像这样:
但在 chrome 和 FF 中看起来很正常:
为什么会发生这种情况?文本区域仍然被提交到我的 php,就好像它里面有东西一样(当我在 IE8 中使用开发工具时,它说里面有内容)
那么为什么在 IE 中它不显示可编辑的文本区域呢?
谢谢....
i have the following function in jQuery and javascript that creates a form element:
createEmail: function(title){
var $emailForm = $('<form>',{action: 'sendEmail.php', id: 'emailForm'});
var $table = $('<table>');
$emailForm.append($table);
var $tr = $('<tr>');
$tr.append($('<td>',{text: 'Email From:'}));
$tr.append($('<td>',{html: '<input type="text" value="" name="from"/>'}));
$table.append($tr);
$tr = $('<tr>');
$tr.append($('<td>',{text: 'Email To:'}));
$tr.append($('<td>',{html: '<input type="text" value="" name="to"/>'}));
$table.append($tr);
$tr = $('<tr>');
$tr.append($('<td>',{text: 'Message Body:'}));
$tr.append($('<textArea>',{name: 'msg', cols: 50, rows: 10,
text: 'Attached is the ' +title+ ' license key file.\nPlease place the file in the same directory as the "check_license.php" file for ' +title+ ' '}));
$table.append($tr);
$tr.append('<input type="hidden" value="'+title+'" name="title"/>');
var $div = $('<div>').append($emailForm).dialog({
title: 'Email ' + title + ' File',
width: 600,
modal: true,
buttons: {
cancel: function(){
$(this).dialog('close');
},
send: function(){
$.post($emailForm.attr('action'), $emailForm.serialize(),function(data){
alert(data);
$div.dialog('close');
})
}
},
beforeClose: function(){
$(this).remove();
}
});
$div.dialog('widget').css('margin','0 auto');
}
For some reason in IE the text area is not showing up and the dialog looks like this when you click on it:
but in chrome and FF it looks normal:
why is this happening? the text area still gets submitted to my php as if it has something in it (and when i use dev tools in IE8 it says there is content in it)
So why in IE does it not display an editable textarea?
Thanks....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我没读错的话,看起来您是将文本区域附加到行而不是单元格中。
If I'm reading correctly, it looks like you're appending your textarea to the row instead of the cell.
也许 IE 无法识别
Perhaps IE is not recognizing the
<textArea>
, try<textarea>
.