Sharepoint 2007 : How to disable TextBox - sharepoint

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

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.

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

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)

Related

Powerapps how to choose fields that are submitted to SharePoint list

I have taken over a project from someone who has left the business.
It is a Microsoft PowerApp which provides users with a form interface to upload items into a SharePoint list.
The submit button in the app works and the function is "SubmitForm(formName)"
My question is how does it know which fields to submit into which column in SharePoint?
for instance if I wanted to create a textbox in the form for "First Name" how would I make the powerapp submit the contents of that textbox into firstname field?
--edit removed screenshot--
I think you lack knowledge of powerapps w.r.t sharepoint.
Go through one of the example mentioned in docs of micro soft and you will get idea of how mapping of fields are done.
Your main concern is mapping fields.
https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/app-from-sharepoint
If you check your edit form, and click on any of your field/data card you will find settings as below. Here I have created custom column as "NumberColumn" and you can find Data properties same for your field as well.

How to make text field to people picker in edit form in SharePoint 2013

There is text filed in which "Author" name saved while submitting new form but while editing that form is there any way by which I can make it People picker and user can select the new name name and save the changes.
Unfortunately Naveen's answer's will not work for you.
The Client People Picker does not apply to SharePoint 2013 on-premise, except when writing a custom AddIn which you are not doing.
You also can't change the existing Text field of Author to be a people field directly as that is an illegal/invalid field type modification.
You will need to edit your existing field and rename it to something like AuthorOld/AuthorText. And then create a new field as a person field named Author.
However, it sounds like you're trying to let the user edit the field for who created the item. That field is locked for editing by end users. You can however, hide that field and just create a new person field with a default value of [Me] (this fills in the current users name when they create an item). Which will let you get the behavior it sounds like you're after :)
What my understanding is in SP Default edit form you have a Text Field to Save the User Value. Now you need to make that Text field as PeoplePicker Control.
You have 2 choice to done this.
1) Go with OOB. Make that Text field which is used to save the "Author" name as User Field. So it will be act as a PeoplePicker control in Both New/Edit Form.
2) Add Content Editor Webpart in the Edit Form. And make that Text Field as Client people picker.
Refer for
Client People Picker
Mark as answer if it helps.

Customize Survey fields in Sharepoint 2007

I have a Survey list which has several questions, one of those is people picker field and the another one is single line of text field.
I need to hide a perticular question ( field ) based on login user. Requirement is as below
When the user logs in as admin
a. Display ‘people picker’ and should not allow user to pick his name from people picker.
b. Hide Single line of Text field.
When the user logs in as ‘Non-Admin’
a. Display ‘Single line of Text' field and default it to have the logged in user name (without domain name).
b. Hide ‘People picker’ control.
I am thinking that we can do it by placing javascript in content editor webpart and add it in newform.apx of survey list. Can anybody give me the proper approach to get it done?
Thanks in advance
You might like to try creating a custom field control, a differnet one for each field.
Javascript is fast and involves minimal deployment, but is fiddly and can be turned off.

Custom column in list

Can any one tell me that, Is is possible in wss to have our custom column in a view of list. The way how we are adding edit and delete column in asp.net grid by setting autogenerateedit button property to true. I have to write my custom login on click event of that button. This action is going to be common for all list items.
Thanks
Sachin K
I am afraid that it is not possible out of the Box in SharePoint (WSS / MOSS). If you want to have such an option, you might need to create a Separate page that will have code to do the opertion. Try out the SPGridView and SPDataSource.
Else I would suggest (Recommend) you to have a look at the DataSheetView option provided by the List, it will list List item details as all editable format, like Excel sheet.

How to validate data input on a sharepoint form?

How does one verify a text field with another list's column? I am currently populating a Drop down list with a datasource and then comparing the text field with items in the dropdown using javascript. Is there a better way?
The second problem I am having is how to trigger the Validate Function.
I am aware of two custom forms for adding data to a sharepoint list. One is created using The Dataview Webpart in Sharepoint Designer and the other is created using the List Form Webpart in Sharepoint Designer.
I have a DataFormWebPart I created using Sharepoint Designer Insert Dataview ->Insert Selected Fields as New Item Form. This gives Save and Cancel buttons at the end of the form. How do I intercept the Save button event?
I found one solution but it only works with the NewForm page that has OK Cancel Buttons. http://www.codeproject.com/KB/sharepoint/Control_validation.aspx
You'll have to use an event handler if you want to validate the state of multiple fields. You can use the ItemAdding/ItemUpdating events if you want to cancel an item which is being added/updated.
properties.Cancle = true;
properties.ErrorMessage = "Your validation message.";
http://msdn.microsoft.com/en-us/magazine/cc163318.aspx
http://blogs.msdn.com/brianwilson/archive/2007/03/05/part-1-event-handlers-everything-you-need-to-know-about-microsoft-office-sharepoint-portal-server-moss-event-handlers.aspx
can you add query strings into the formula box for validation?
e.g. like this:
^[a-zA-Z]{2}[0-9]{6}[A-Za-z]{1}$
which validates against a national insurance number.
sharepoint says the column must = true,
so could I enter something like
[column name] = ^[a-zA-Z]{2}[0-9]{6}[A-Za-z]{1}$
I think you are trying to build a tool like this one called SharePoint Form Validation.
If so, take a look at this blog: http://office.microsoft.com/en-us/sharepointtechnology/HA101054791033.aspx?pid=CH100650061033
Hope this helps!

Resources