问题描述
我有我的jQuery移动/ Modernizr的网站上的表单。我使用jQuery移动1.1.0-RC.1。我有我的网页上这种形式,它不提交。点击搜索按钮也绝对没有什么。我不知道为什么。任何想法?
< p数据提升=false的>
<形式的行动=/主页/搜索的方法=获取>
< UL数据角色=列表视图数据插入=真正的>
<李数据角色=名单除法>搜索和LT; /李>
<立GT;
< DIV CLASS =UI并网一个>
< DIV CLASS =UI块-A的风格=垂直对齐:中间;>
<输入ID =查询NAME =查询类型=文本值=/>
< / DIV>
< DIV CLASS =UI块-B的风格=垂直对齐:中间;最大宽度:150像素;>
<输入数据的ajax =false的数据图标=搜索类型=提交值=搜索数据角色=按钮数据迷你=真的风格=垂直对齐:中间; />
< / DIV>
< / DIV>
< /李>
< / UL>
< /表及GT;
&所述; / P>
由于@supertopi表明,它不建议有一个 P
标记中的表单。
见这个优秀的帖子,详细描述问题:
也许你可以发布更多code或检查你的错误日志?上面的HTML确实在jsfiddle.net工作 -
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/
这篇关于表单不会提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!