【发布时间】:2011-04-13 19:35:20
【问题描述】:
我在 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 中它不显示可编辑的文本区域?
谢谢....
【问题讨论】:
-
可以试试小写
textarea吗?
标签: php javascript jquery forms textarea