Sharepoint 2007:如何禁用文本框
我是 sharepoint 2007 的新手。我有以下要求。
1)我想为员工创建一个自定义列表,他们可以在其中选择项目并填写表格并提交。
示例:列表 -->硬盘 -->点击-->创建新列表 -->
列表具有以下字段 1) EmpID 2) 客户名称(文本),3) 订单日期,4) 数量 5) 价格
一旦用户提交列表,我想禁用 EMPID 字段并允许同一用户编辑其他字段,如果必需的。
如何禁用 Sharepoint 2007 中的文本字段 (Empid)?我将不胜感激任何其他替代或更好的想法。
谢谢, 问候 维克
I am new to sharepoint 2007. I have a following requirement.
1) I would to create a custom list for employee where they can select the item and fill-out the form and submit.
Example : List --> Hard Disk --> Click --> Create new list -->
List has following fields 1) EmpID 2) Customer name (Text) , 3) Order Date, 4) Qty 5) Price
Once user submit the list then I would like to disable the EMPID field and allow same user to edit the other fields if required.
How can I disable the text field (Empid) in the Sharepoint 2007 ? I would appreciate any other alternate or better idea.
Thanks,
Regards
Vick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会使用 jQuery 来达到这个目的。以下是描述如何隐藏文本字段的示例在 SharePoint 表单上。将
.hide()
更改为.attr('disabled','disabled')
这将禁用文本字段。如果您需要部署 jQuery 方面的帮助,查看此问题。
I would use jQuery for this purpose. Here is an example that describes how to hide a text field on a SharePoint form. Change the
.hide()
to.attr('disabled','disabled')
and this will disable the text field.If you need help with deploying jQuery, see this question.
我不确定这是否是一个更好的主意,但我曾经在这种常见情况下这样做过
首先
识别 html 源代码中的文本框 ID(通过网络浏览器查看源代码),之后我编写了 javascript 函数来禁用文本框,即 EMPID,或者我们可以通过样式表并使用 javascript 应用样式。
I am not sure its a better idea or not, but for that i used to do for this common scenario
that
fist identify the textbox id in html source (through web browser view source) after that i wrote javascript function to disable textboxes i.e. EMPID or we can do through style sheet and apply style using javascript..
您可以为同一列表创建多种内容类型。让用户填写包含 EmpID 字段的内容类型(在 LeftNav 中放置一个链接,将用户发送到具有正确 ContentTypeId 的 NewItem.aspx)。将默认内容类型设置为不带 EmpID 的内容类型,这样当他们返回并编辑时,他们将看不到该 EmpID 字段。
这样做的缺点是他们会在“新建”按钮下拉列表中看到两种内容类型。您可以以有意义的方式命名它们(新硬盘顺序、编辑硬盘顺序)
You can create multiple content types for the same list. Have the user fill out the content type that contains the EmpID field (put a link in the LeftNav that sends them to NewItem.aspx with the proper ContentTypeId). Make the default content type the one without the EmpID, so when they go back in and edit they won't see that EmpID field.
The downside to this is that they'll see both content types in the New button dropdown. You can name them in a way that makes sense (New Hard Disk Order, Edit Hard Disk Order)