views:

224

answers:

3

Hello,

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

A: 

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..

Jaswant Agarwal
+1  A: 

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.

Alex Angas
A: 

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)

UrbanDude