如果我点击div将在添加页面中显示的按钮,所以它在添加页面工作,而comin编辑页面我在时间按钮事件不使用时使用valus显示div如果condion ... [英] if i click the button that div will show in add page so it is working in add page while comin to edit page i displ div using valus at the time button event is not working how to give if condion...

查看:96
本文介绍了如果我点击div将在添加页面中显示的按钮,所以它在添加页面工作,而comin编辑页面我在时间按钮事件不使用时使用valus显示div如果condion ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script type="text/javascript">
    function showSecond(a) {
        $('#second').show();
        $('#btn1').hide();
    }









用户类型


User Type






@ Html.EditorFor(model => model.UserType)

@Html .ValidationMessageFor(model => model.UserType)

@Html.EditorFor(model => model.UserType)
@Html.ValidationMessageFor(model => model.UserType)






用户名


User name






@ Html.EditorFor(model => model.Useranme)

@ Html.ValidationMessageFor(model => model.Useranme)

@Html.EditorFor(model => model.Useranme)
@Html.ValidationMessageFor(model => model.Useranme)






密码


Password






@ Html.EditorFor(model => model.Password)

@ Html.ValidationMessageFor(model => model.Password)@ if(@ Model.UserType1 == null){< input type =buttonvalue =addid =btn1onclick =showSecond(); class =myButton1/>}

@Html.EditorFor(model => model.Password)
@Html.ValidationMessageFor(model => model.Password) @if(@Model.UserType1==null){<input type="button" value="add" id="btn1" onclick="showSecond();" class="myButton1" />}






@if(@ Model.UserType1!= null ||)

{


@if (@Model.UserType1 != null || )
{






用户类型


User Type






@ Html.EditorFor(model => model.UserType1)

@ Html.ValidationMessageFor(model => model.UserType1)

@Html.EditorFor(model => model.UserType1)
@Html.ValidationMessageFor(model => model.UserType1)






用户名


User name






@ Html.EditorFor(model => ; model.Useranme1)

@ Html.ValidationMessageFor(model => model.Useranme1)

@Html.EditorFor(model => model.Useranme1)
@Html.ValidationMessageFor(model => model.Useranme1)






密码


Password






@ Html.EditorFor(model => model.Password1)

@ Html.ValidationMessageFor(model => model.Password1)

@ *< input type =buttonvalue =addid =btn2onclick =showThird();class =myButton1/> * @@if(@ Model.UserType2 == null){@ *< input type =buttonvalue =addid =btn2onclick =showThird();class =myButton1/> * @}

@Html.EditorFor(model => model.Password1)
@Html.ValidationMessageFor(model => model.Password1)
@*<input type="button" value="add" id="btn2" onclick="showThird();" class="myButton1" />*@ @if(@Model.UserType2==null){@*<input type="button" value="add" id="btn2" onclick=" showThird();" class="myButton1" />*@}




}

推荐答案

('#second')。show();
('#second').show();


('#btn1')。hide();
}
('#btn1').hide(); }









用户类型


User Type






@ Html.EditorFor(model => model.UserType)

@ Html.ValidationMessageFor(model => model.UserType)

@Html.EditorFor(model => model.UserType)
@Html.ValidationMessageFor(model => model.UserType)






用户名


User name






@ Html.EditorFor(model => model.Useranme)

@ Html.ValidationMessageFor(model => model.Useranme)

@Html.EditorFor(model => model.Useranme)
@Html.ValidationMessageFor(model => model.Useranme)






密码


Password






@ Html.EditorFor(model => model.Password)

@ Html.ValidationMessageFor(model => model.Password)@if( @ Model.UserType1 == null){< input type =buttonvalue =addid =btn1onclick =showSecond();class =myButton1/>}

@Html.EditorFor(model => model.Password)
@Html.ValidationMessageFor(model => model.Password) @if(@Model.UserType1==null){<input type="button" value="add" id="btn1" onclick="showSecond();" class="myButton1" />}






@if(@ Model.UserType1!= null ||)

{


@if (@Model.UserType1 != null || )
{






用户类型


User Type






@ Html.EditorFor(model => model.UserType1)

@ Html.ValidationMessageFor(model => model.UserType1)

@Html.EditorFor(model => model.UserType1)
@Html.ValidationMessageFor(model => model.UserType1)






用户名


User name






@ Html.EditorFor(model => model.Useranme1)

@ Html.ValidationMessageFor(model => model.Useranme1)

@Html.EditorFor(model => model.Useranme1)
@Html.ValidationMessageFor(model => model.Useranme1)






密码


Password






@ Html.EditorFor(model => model.Password1)

@ Html.ValidationMessageFor(model => model.Password1)

@ *< input type =buttonvalue =addid =btn2onclick =showThird();class =myButton1/> * @@if(@ Model.UserType2 == null){@ *< input type =buttonvalue =addid =btn2onclick =showThird();class =myButton1/> * @}

@Html.EditorFor(model => model.Password1)
@Html.ValidationMessageFor(model => model.Password1)
@*<input type="button" value="add" id="btn2" onclick="showThird();" class="myButton1" />*@ @if(@Model.UserType2==null){@*<input type="button" value="add" id="btn2" onclick=" showThird();" class="myButton1" />*@}




}


这篇关于如果我点击div将在添加页面中显示的按钮,所以它在添加页面工作,而comin编辑页面我在时间按钮事件不使用时使用valus显示div如果condion ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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