在 MS CRM 4 中使用 JavaScript 使字段对用户不可用
我正在尝试禁用一个字段,即将其灰显并且不允许用户选择它。为了达到这种效果,我目前正在调用
crmForm.all.new_attribute1.disabled = true;
crmForm.all.new_attribute2.Disabled = true;
“禁用”(大写 D),使该字段变灰,但用户仍然可以将光标放在该字段或选项卡中。
禁用(带有一点 d)使该字段对于光标和选项卡不可用,但没有给出无法与其交互的视觉指示。
有没有更好的方法来做到这一点,一个电话就能达到类似的结果,还是我只能同时拥有这两个电话?
I am trying to disable a field, i.e. grey it out and not allow the user to select it. To achieve this effect I am currently calling
crmForm.all.new_attribute1.disabled = true;
crmForm.all.new_attribute2.Disabled = true;
The Disable, with a capital D, makes the field grayed out but the user can still put the cursor in that field or tab to it.
The disable, with a little d, makes the field unavailable to the cursor and via tab, but gives no visual indication that it can't be interacted with.
Is there a better way to do this, one call that will achieve similar results or am I stuck having both there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用“禁用”属性应该可以。
您可以尝试将此代码放入 Account 实体的 OnLoad 事件中(不要忘记启用 Event 和 Publich 实体!):
并且“Account Number”将被阻止并变灰,如下图所示:
(来源:vidmar.net)
Using "Disabled" property should work.
You can try putting this code in OnLoad event of Account entity (don't forget to enable Event and Publich entity!):
And "Account Number" will be blocked and greyed as seen in this picture:
(source: vidmar.net)
您正在谈论只读和禁用。
发表了一篇很棒的文章 http://customerfx .com/pages/crmdeveloper/2006/03/06/readonly-and-disabled-fields.aspx ...也许这会有所帮助。
You are talking about readOnly and disabled.
A great article was posted http://customerfx.com/pages/crmdeveloper/2006/03/06/readonly-and-disabled-fields.aspx ... maybe this could help.