首页 \ 问答 \ Yii2禁用字段(Yii2 disable field)

Yii2禁用字段(Yii2 disable field)

在yii2中,我有两个字段(Text1和Text2)。 如果第一个字段(Text1)不为null,我想禁用第二个字段(Text2)。 我认为这可以用javascript完成,但我真的不知道。 有谁能够帮助我?


In yii2 I have two fields (Text1 and Text2). I want to disable the second field (Text2) if the first field (Text1) is not null. I think this can be done with javascript but I dont't really know. Can anybody help me?


原文:https://stackoverflow.com/questions/47328704
更新时间:2022-10-11 17:10

最满意答案

如上所述,NSGod将int index更改为NSUInteger index解决了这个问题


As mentioned above by NSGod, changing int index to NSUInteger index solved the problem

相关问答

更多
  • 我自己开始使用IKImageBrowserView,之前我没有注意到这一点,但实际上我尝试了它并且看到了与我自己的应用程序相同的行为。 看起来IKImageBrowserView上有一个名为_shouldProcessLongTasks的私有方法。 我尝试重写它只返回NO,这似乎阻止了视图中尚未显示的图像的预加载行为(至少在Snow Leopard下,必须在Leopard下测试以查看行为是否相同) 。 看起来像一个风险相当低的私有API使用,因为如果方法发生变化,它就不再被调用了。 当您在此处向Apple提 ...
  • 编辑: 根据ItemAnimator文档 : 此类定义了对适配器进行更改时在项目上进行的动画。 因此,除非您将您的项目逐个添加到RecyclerView并在每次迭代时刷新视图,我不认为ItemAnimator是您需要的解决方案。 以下是使用CustomAdapter显示RecyclerView项目时如何动画化 public class CustomAdapter extends RecyclerView.Adapter { private Cont ...
  • 我认为通过使用带DoubleAnimation的TranslateTransform来实现这一点是最简单的。 您可以使用DoubleAnimation随时间更改X和Y值,以提供在屏幕外移动的外观。 DoubleAnimation doubleAnimation = new DoubleAnimation(); itemToAnimate.RenderTransform = (Transform)new TranslateTransform(); 然后当我必须设定目标时 Storyboard ...
  • 尝试这个: /// /// Move the given item to the given index in the given group /// /// The item and group must belong to the same ListView public void MoveToGroup(ListViewItem lvi, ListViewGroup group, int indexInGroup) { ...
  • 它应该是transition而不是animation 。 $('.items').on('click', e => { $(e.currentTarget).find('div').css('transform', 'translateX(-100px)') }) #carousel { height: 25vh; width: 25vw; position: absolute; top: 0; left: 0; bottom: 0; right: 0; ...
  • 好吧,我不确定这是否正是你想要的,但这里有一个基于你的代码的jsFiddle随机动画div的位置和不透明度。 我根据上面的评论做了更正。 更新:我已根据您的评论更新了小提琴。 我做了什么: 在movimiento函数中,我们首先必须计算当前位置,以便...... ...我们可以用它来计算新坐标的中途位置 在中间点添加一个额外的动画,以便我们可以从不透明度0动画到1。 将缓动设置为线性,因此两个动画都是相同的速度。 如果要为整个动画应用缓动值,则要复杂得多。 更新2:对不起,我在计算中途点时犯了一个错误。 固 ...
  • 似乎jQuery动画遇到了相对定位项目的问题,删除了相对位置和使用的边距,现在似乎工作。 Seems jQuery animate runs into issues with relatively positioned items, removed relative position and used margin and it seems to work now.
  • 这个怎么样: public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { myHolder = holder as MyView; if (position > mCurrentPosition) { Handler h = new Handler(); int currentAnim = Android.Resource.Animation ...
  • 如上所述,NSGod将int index更改为NSUInteger index解决了这个问题 As mentioned above by NSGod, changing int index to NSUInteger index solved the problem
  • IKImageBrowserView是一个NSView,因此您可以使用以下函数添加工具提示矩形: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/doc/uid/20000014-SW47 对于我的实现,我将图像浏览器放在一个不调整大小的scrollview中,所以我只需要在使用 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)