简体   繁体   English

radiobutton不适用于jQuery移动样式吗?

[英]radiobutton doesn't apply jQuery mobile styling?

I'm working on my MVC project with jQuery mobile, I create a partial view page (_createanswer) and inside the page I have: 我正在使用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

and this partial page integrated with the View page (details). 并将此部分页面与“查看”页面集成(详细信息)。

On my (details) page I have: 在我的(详细信息)页面上,我有:

    @{
    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>

My question is all those radio button does not have Jquery mobile styling, can someone help please? 我的问题是所有那些单选按钮都没有Jquery移动样式,有人可以帮忙吗?

I think you might need to wrap those in a control group (or so it's shown on jQuery Docs), also labels and different id-s are not bad: 我认为您可能需要将它们包装在一个控制组中(或者这样显示在jQuery Docs上),而且标签和不同的ID也不错:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM