0

我正在使用 jQuery mobile 处理我的 MVC 项目,我创建了一个局部视图页面 (_createanswer),并且在我拥有的页面内部:

<input type ="radio" value="1" name="select-answer" id="select-answer" /> Agree
<input type ="radio" value="1" name="select-answer" id="select-answer" />Disagree
<input type ="radio" value="2" name="select-answer" id="select-answer"/>Strongly Agree 
<input type ="radio" value="3" name="select-answer" id="select-answer"/>Strongly Disagree

并且此部分页面与查看页面(详细信息)集成在一起。

在我的(详细信息)页面上,我有:

    @{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.Mobile.cshtml";

}

<div class="content_title ">
    Question @Model.Id. @Model.Name
</div>
<div class="content_area">
    <div class="text">

        @using (Html.BeginForm("Create", "MayoAnswers"))
        {
            @Html.Partial("_CreateAnswer")

            <div class="innerspacer">
                <input type="submit" value="Next" data-theme="d" />
            </div>

        }
    </div>
</div>

我的问题是所有那些单选按钮都没有 Jquery 移动样式,有人可以帮忙吗?

4

1 回答 1

1

我认为您可能需要将它们包装在一个控制组中(或者它显示在 jQuery Docs 上),标签和不同的 id-s 也不错:

<fieldset data-role="controlgroup">
<input type ="radio" value="1" name="select-answer" id="select-answer-1" />
<label for="select-answer-1">Agree</label> 
<input type ="radio" value="1" name="select-answer" id="select-answer-2" />
<label for="select-answer-2">Disagree</label> 
<input type ="radio" value="2" name="select-answer" id="select-answer-3"/>
<label for="select-answer-3"> Strongly Agree </label>
<input type ="radio" value="3" name="select-answer" id="select-answer-4"/>
<label for="select-answer-4"> Strongly Disagree </label>
</fieldset>
于 2012-12-14T15:30:31.830 回答