【问题标题】:textarea not displaying IE but is getting submittedtextarea 不显示 IE 但正在提交
【发布时间】: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


【解决方案1】:

如果我没看错,看起来您将 textarea 附加到行而不是单元格。

【讨论】:

  • 是的,修复了它!太感谢了!不错的收获!为什么这只会影响 IE?
【解决方案2】:

也许 IE 无法识别&lt;textArea&gt;,试试&lt;textarea&gt;

【讨论】:

    猜你喜欢
    • 2011-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-12
    • 1970-01-01
    • 1970-01-01
    • 2011-04-19
    • 1970-01-01
    相关资源
    最近更新 更多