$(“#id”)。serialize()在opera中不起作用

时间:2011-05-09 09:42:02

标签: jquery cross-browser

我正在尝试创建一个反馈框。它在Firefox中运行良好,但是当我在Opera 11.01中检查它时,我发现$("#FormContainer").serialize()无效。

x=$("#FormContainer").serialize();
alert(x);

警告信息为:Description=&Title=

值丢失。

如果我不编辑textareas,我也发现我得到了默认值。也就是说,当我不编辑textareas时,警告消息是'Description = Share + an + idea%2C + problem%2C +或+ question。& Title = Subject'。

我该如何解决这个问题?

<script>  
    $(document).ready(function(){  
    $("#result").load('idea.php');});
</script>  

<body>
    <div id="my-dialog">
                <form name="FormContainer" id="FormContainer">
                     <table id="result"></table>
                </form>
           </div>
   </body> 

idea.php

    <tr>
        <td height="15" colspan="5"></td>
    </tr>
    <tr>
        <td>
            <textarea name="Description" id="description"
                      value="Share an idea, problem, or question."
                      onfocus="if (this.value==this.defaultValue) this.value='';"
                      cols="20" rows="10"
                      style="width:465px;color:grey;font-size:15px;"
                      wrap="hard">
                Share an idea, problem, or question.
            </textarea>
        </td>
    </tr>
    <tr>
        <td height="7" colspan="5"></td>
    </tr>
    <tr>
        <td>
            <textarea type="text" name="Title"
                      id="title" value="Subject."
                      onfocus="if (this.value==this.defaultValue) this.value='';"
                      cols="20" rows="10"
                      style="width:465px;color:grey;font-size:15px;"
                      wrap="hard">
                Subject.
            </textarea>
        </td>
    </tr>

0 个答案:

没有答案