表单不会提交 [英] Form will not submit

查看:97
本文介绍了表单不会提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的jQuery移动/ Modernizr的网站上的表单。我使用jQuery移动1.1.0-RC.1。我有我的网页上这种形式,它不提交。点击搜索按钮也绝对没有什么。我不知道为什么。任何想法?

 < p数据提升=false的>
            <形式的行动=/主页/搜索的方法=获取>
    < UL数据角色=列表视图数据插入=真正的>
        <李数据角色=名单除法>搜索和LT; /李>
        <立GT;
            < D​​IV CLASS =UI并网一个>
                    < D​​IV CLASS =UI块-A的风格=垂直对齐:中间;>
                    <输入ID =查询NAME =查询类型=文本值=/>
                < / DIV>
                < D​​IV CLASS =UI块-B的风格=垂直对齐:中间;最大宽度:150像素;>
                    <输入数据的ajax =false的数据图标=搜索类型=提交值=搜索数据角色=按钮数据迷你=真的风格=垂直对齐:中间; />
                < / DIV>
            < / DIV>
        < /李>
    < / UL>
            < /表及GT;
&所述; / P>


解决方案

由于@supertopi表明,它不建议有一个 P 标记中的表单。

见这个优秀的帖子,详细描述问题:为什么不表格嵌套p中是有效的XHTML

也许你可以发布更多code或检查你的错误日志?上面的HTML确实在jsfiddle.net工作 - http://jsfiddle.net/shanabus/5V9sn/

I have a form on my jquery-mobile/modernizr site. I'm using 1.1.0-rc.1 of jquery-mobile. I have this form on my page, and it does not submit. Clicking the search button does absolutely nothing. I don't know why. Any ideas?

<p data-enhance="false">
            <form action="/Home/Search" method="get">
    <ul data-role="listview" data-inset="true">
        <li data-role="list-divider">Search</li>
        <li>
            <div class="ui-grid-a">
                    <div class="ui-block-a" style="vertical-align: middle;">
                    <input id="Query" name="Query" type="text" value="" />
                </div>
                <div class="ui-block-b" style="vertical-align: middle; max-width: 150px;">
                    <input data-ajax="false" data-icon="search" type="submit" value="Search" data-role="button" data-mini="true" style="vertical-align: middle;" />
                </div>
            </div>
        </li>
    </ul>
            </form>  
</p>

解决方案

As @supertopi suggests, its not recommended to have your form inside of a p tag.

See this excellent post describing the problem in detail: Why doesn't form nested in p validate as XHTML

Maybe you could post more code or check your error log? The HTML above does work in jsfiddle.net - http://jsfiddle.net/shanabus/5V9sn/

这篇关于表单不会提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆