使用jQuery的MVC3文本框中的必填字段设置 [英] mandatory field setting in MVC3 textbox using jQuery

查看:98
本文介绍了使用jQuery的MVC3文本框中的必填字段设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

我有
这样的场景
Dropdownbox名称性别数据-女性,男性
文本框产假-如果用户选择女性,则此文本框必须为必填

如果选择男性选项,则禁用文本框

可以让任何人知道如何使用jQuery在MVC3中做到这一点
是MVC3和jQuery的全新内容

请任何人帮助我

谢谢

HI ,

I have scenario like

Dropdownbox name Sex data- female,male
Textbox maternitydays- if user choose female then this Textbox must be mandatory

if the choose in male option then textbox disabled

CAn anyone give idea how to do this in MVC3 using jQuery
Am completely new to MVC3 and jQuery

please help me anyone

Thanks

推荐答案

亲爱的金伯利,

请使用以下代码

Dear kimberly,

Please use following code


(" span>).change(function() { 如果(. == ' 女性')
("#drpSex").change(function() { if(this.value== 'female')


(#txtMaternityDays').removeAttr( ); 其他
('#txtMaternityDays').removeAttr("disabled"); else


这篇关于使用jQuery的MVC3文本框中的必填字段设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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