Pages

Monday, June 22, 2009

How to customize edit forms in SharePoint designer 2007

Hello Friends

v      Business Case:

Let’s say we have custom list and when any user enters a new item into list, every field must be editable, but when user edits any item, at that time some of fields should not be editable, they should come only for display purpose.

v      Possible Solution:

We can develop custom web part and write code to make some fields read only but we can easily achieve above functionality by just customizing edit forms into SharePoint designer.

v      Solution:

A very simple solution

1>     Open SharePoint Designer 2007

2>     Open your SharePoint site

3>     Open Custom list

4>     Select Editform.aspx and .right click on it same file

5>     Click on “New from Existing Page” Option value, it will create one new custom ASPX page for us from existing one.




















6>     Delete one web part which is already there into page and add click on Insert SharePoint Controls  -> Custom List Form.



7>     Select Appropriate List, it’s content type and Type of Form to create as per below image.

























8>     Click Ok button. It will automatically add one new Data Form Web part with all list fields in edit mode.

9>     Now you can change this form as per your needs and requirements. Like if you do not want some of fields then you can delete those fields from current page. In my requirement I have to make “EmployeeID” as read only field means user can see the field but they can’t change the field values..

10>  Select EmployeeID Field from user interface. Click on “tag Properties”, there you can see “Control Mode” as Edit.












11>  when you click on ControlMode option, you can see available values that are Invalid, Display, Edit and New. Select “Display” as option value for displays purpose.















12>  Save form under your current site name -> Lists->List Name and give file name with .aspx extension.


















13> Select List -> Right Click List Properties and Go to Supporting Files and In Edit Item Form Properties, Browse to Your newly created Form and click on apply and Save the site.



14>  Go to your SharePoint site .Select list and click on edit item, here in edit page you can see the result.

















In these ways from SharePoint designer, we can make some of the fields as read only and editable also, I think, SharePoint designer is very powerful tool; just we need to find in which way we can take advantage of designer functionality!!

68 comments:

  1. Great articles!
    I followed the steps, but UN-success on step number 13.

    I right-clicked on my custom list ... chose Properties ... clicked on Support Files... clicked on Browsed ... and assigned to the new form ... OK ... Apply ... OK

    But it still not change the configuration to the new form

    I, immediately, go over step 13, and saw that it is still pointing to the old form

    I am not sure how to trouble shoot this issue

    Any helps are greatly appreciated

    ReplyDelete
  2. Hey,
    Thanks for the comments.

    I think I didn’t write enough information into my article and I missed one important thing over here. Can you please check below things?
    In step # 13,


    1. Click on supporting files.
    2. Choose “Item” option value from the “Content Type specific items” section and then browse to your new form and assigned into NEW/EDIT Item form.

    This is main step, because when we are changing or assigning our new form into supporting files TAB and clicks on OK, it automatically changed to default content type and old form names, we need to first change/select “Item” content type and then we need to change/assigned our new form.

    Please try these steps and let me know if you get success or not, then I’ll add same steps into my article.

    Thanks,
    Disha Shah

    ReplyDelete
    Replies
    1. Okay, I finally realized what you were writing here? I had never right-clicked on properties before to know that three was something there. Thank you. I do suggest screen shots for this # 13 actions.

      Delete
    2. Hi Unknown:)

      Sure I will provide the screen shots for #13. I am glad it helps you to solve this problem!!

      Thanks
      Disha Shah

      Delete
  3. Thank you for such a quick response
    and thank you for the specific information
    I tried it, and it worked

    Have a great day

    ReplyDelete
  4. Thanks Disha,
    My first idea was to create a custom column type such that all the columns using this type can have such hiding feature in edit item mode and asusual in add item mode but mean while I saw this article and this is great. But I have to repeat each and every list like this. I think this will suit if we are not aware of the task while creating list then afterwards we can do this. Can we create a custom column type that suits this buisiness case?

    Regards,
    Harish

    ReplyDelete
  5. Hey Harish,

    By looking at your business requirements, I think below link will help you, after deployment of below solution package, we can hide/display make read only any columns into any list within SharePoint site.

    http://officetoolbox.codeplex.com/

    Codeplex also giving free source code for above utility, so if you would like to modify anything then you can make changes into code and make your own custom utility.

    Please let me know if this fits into your case or not.

    Thanks,
    Disha Shah

    ReplyDelete
  6. Thanks Disha,
    yes you are right I think the link you provided me will suits my requirement more in fact its giving the user more flexibility. Thanks for the link.
    I am even using Toolbar manager feature provided at http://www.codeplex.com/features to hide the 'new'menu option in toolbar for some lists.

    ReplyDelete
  7. Hi Harish,

    That’s correct about the link which I sent you, user have more flexibility to change look and feel of SharePoint list.

    Codeplex Feature utility is also good.

    Thank you very much for the information.

    Enjoy!
    Disha Shah :)

    ReplyDelete
  8. The previous steps doesnt work when i want to make (a dropdown list or date or a radio button) on a display mode!!
    It`s Works Only when i change a text box to a display mode.

    ReplyDelete
  9. Hey Gina Yeap,YOU are RIGHT...In edit form if we set Controlmode= "Display" for Dropdown and Date controls, it won’t work...

    But I have some alternatives to do that

    # 1:

    Let me explain by an example, I have two fields

    1> Status - DropDown Control

    2> StartDate – DateTime Control

    When I added Custom List form from Sharepoint Designer 2007 , I got this kind of lines for DropDown Control and DateTime control and You have to replace described like below.

    For Status - *DropDown Control *

    *Replace LINE *



    * WITH*



    For StartDate –*DateTimeControl*

    *Replace LINE*



    *WITH*



    # 2: Below is codeplex free tool; see if you can leverage this for your purpose.

    http://officetoolbox.codeplex.com/

    Thanks,

    Disha Shah

    ReplyDelete
  10. Hye Disha,

    Thank you for posting this useful article.
    I have followed the steps plus the steps 13 from the comment.. and it works! :)

    However, iahve difficulty editing page from one of the Microsoft 40 template (Call Center Template).
    When I changed the edit page, it gives me this error:

    " An unexpected error has occurred.

    Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
    Troubleshoot issues with Windows SharePoint Services.
    "

    If you might know where I did wrong. I would be much appreciated.

    Thanks again..

    ReplyDelete
  11. Ashiena

    It is good to hear that it helps you.

    There are lots of possibilities to occur "An unexpected error has occurred" error.

    To know the specific error, please refer this and try to get more detail about error description and please send me same details, I will try my best to solve that.

    http://dishashah.wordpress.com/2009/08/08/how-to-display-detailed-error-messages-into-sharepoint-page/

    Thanks, Disha Shah

    ReplyDelete
  12. Hi Disha,

    This is Suresh, working as a sharepoint developer past 2 years. I have only experience in SharePoint development using sharepoint designer. Now I'm learning object model. If possible help me to learn more about Object Model Programming.

    Thanks in Advance.

    Rgds,
    Suresh.

    ReplyDelete
  13. Hey Suresh

    It's good to hear from you that you need to start programming in SharePoint Object Model. Yeah if you stuck anywhere during SharePoint Object Model Programming then let me know I will try my best to help you.

    If you know any programming languages like .NET or anything then you can speed up SharePoint Object Model very well, same like all languages it's giving classes, methods into SharePoint APIs.

    Good link to start with: http://msdn.microsoft.com/en-us/library/bb687949.aspx

    Thanks, Disha Shah

    ReplyDelete
  14. hi disha. this is pratik here. How are you? what's up? Good to see you blogging. Keep it up. I suggest you to Put your Twitter as well as facebook ID so that anyone can follow.

    ReplyDelete
  15. Sorry ,,Could you please explain this steps agian
    For Status – *DropDown Control *

    *Replace LINE *

    * WITH*

    For StartDate �*DateTimeControl*

    *Replace LINE*

    *WITH*
    i couldnt got what you say !!
    Thanks inadvance.

    ReplyDelete
  16. Hey Gina

    I don't know that somehow code lines didn’t display correctly, I write down that reply one more time.

    Yeap,YOU are RIGHT...In edit form if we set Controlmode= "Display" for Dropdown and Date controls, it won’t work...
    But I have some alternatives to do that

    # 1:
    Let me explain by an example, I have two fields
    1> Status - DropDown Control
    2> StartDate – DateTime Control
    When I added Custom List form from Sharepoint Designer 2007 , I got this kind of lines for DropDown Control and DateTime control and You have to replace described like below.

    For Status - DropDown Control
    Original LINE :--
    SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Edit" FieldName="Status" __designer:bind="{ddwrt:DataBind('u',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Status')}"

    Change like this -->
    xsl:value-of select="@Status"

    For StartDate –DateTimeControl
    Original LINE-->
    SharePoint:FormField runat="server" id="ff8{$Pos}" ControlMode="Edit" FieldName="StartDate" __designer:bind="{ddwrt:DataBind('u',concat('ff8',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@StartDate')}"

    Change like this
    xsl:value-of select="ddwrt:FormatDate(string(@StartDate), 1033, 5)"

    # 2: Below is codeplex free tool; see if you can leverage this for your purpose.
    http://officetoolbox.codeplex.com/

    Thanks,
    Disha Shah

    ReplyDelete
  17. Thank you for this very useful info.

    How do we change programming language from javascript to vb in designer 2007?

    Thank you very much.

    Cliferd

    ReplyDelete
  18. Cliferd

    Thank you very much for compliments.

    You can change the to but not to VB. If you want to make/change page to VB then that SharePoint page must be a custom page. Change the page language at the top of the page.

    SharePoint Designer 2007 does not support code-behind -> http://www.andrewconnell.com/blog/archive/2006/08/03/3293.aspx

    One recommendation here - In-line Client-side script is not allowed in site pages by default (Security reasons). For thing which you are trying to do, you have to create a custom content page in Visual Studio and reference the master page and install page it in _layouts folder.

    I hope that I understood your question correctly and give you proper answer.

    Thanks
    Disha Shah

    ReplyDelete
  19. Hi Disha,

    I would like to implement same thing for Document Library.
    But the problem is according to step 6 I am unable to find Insert SharePoint Controls -> Custom List Form.
    Custom List Form option is disabled.

    Please let me know if there is any other way to achieve this in Document Libraries.

    Thanks for such a nice article.

    Syed

    ReplyDelete
  20. Hi

    Please ignore my previous comments. I am able to implement it.

    Thanks once again for the beautiful article.

    Regards,
    Syed

    ReplyDelete
  21. Hi Syed

    Thanks for appreciation and comment.

    I have one request, if you would like to share your solution with the problem that you faced and resolved, it will be really very grateful for other people too

    Thanks
    Disha Shah

    ReplyDelete
  22. Hi Disha,

    The requirement was to make a multiple line textbox to read only and this was in Document Library.

    I was facing problem when I remove the default web part in the newly added EditForm2, I was unable to see the EditForm if when do so.
    And if I don't remove the default web part it was displaying the newly created EditForm2 with the default web part. So, I was seeing two forms at a time.

    To overcome this I have just gone to the code part in SP designer and commented the code of default Web part and it worked. The problem was when I was deleting the default web part it was deleting the some other xml tag.

    Disha I have one question can't we delete the default EditForm?

    Thanks,
    Syed

    ReplyDelete
  23. I'm having a problem finding where to do Step 13. Where do I find the "List Properties"? Is this in SharePoint (webpage) or in SP Designer? I found this screenshot on the web, but where is this on my PC (SharePoint or Designer)? Please help as I am so close!

    ReplyDelete
  24. Hi Robert

    You need to do step #13 in Sharepoint Designer. You can find all your lists in Wesite Panel. and Right click on that List , you will find properties.

    Best Regards
    Disha Shah

    ReplyDelete
  25. Hi
    I am new to sharepoint.I need to create a approval workflow in sharepoint designer.I created a custom list for the user to fill his request,then created a task to manager to approve or reject the request.then given coditions to according to manager decision.workflow is working but i want to display some data filled by user in his request to task of manager(name and id) .can u please help me in this scenario

    thnks

    ReplyDelete
  26. Hi,

    By looking at your requirement, it seems that you need to do some type of trade-off between your requirement and the tool which you are going to use, I mean you can’t display filled data into user request form from designer workflow, I am guessing that you have used “Collect Data from User” activity and need to add some more fields which are already there into your list, right? As per my understanding “Collect Data from User” activity into designer workflow is giving limited functionality and features.

    Here you can do two things.
    1> You can create approval workflow into visual studio and create task edit form, in which you can put any data you want …

    2> In designer workflow, you can create one more extra activity called “send email” before collecting data from user, in email activity you can passed all the data which already there into your custom list then you can assign task for the user, in these way user already got email with all the details before working on any task, you can get more idea from this link http://office.microsoft.com/en-us/sharepointdesigner/HA102390421033.aspx

    Let me know if you find some different approach about your requirement.

    Hope this Helps!!!
    Best Regards
    Disha Shah

    ReplyDelete
  27. Thanks a Lot this really helped me.
    But there is a small issue When is tried to replace the existsing file the Link didn't work it started giving “Invalid page URL” message (page was opening when the URL is typed). To Handle this Error please refer the below Website.
    http://chanakyajayabalan.wordpress.com/2009/11/30/invalid-page-url-new-item-in-sharepoint/

    ReplyDelete
  28. Hello Disha,
    Your article was a great help for me. Thanks for your endeavor.

    ReplyDelete
  29. Hi Disha,
    Is there any solution to enable attachment on NewForm.aspx of a custom list.
    My requirement is a getting some values from user, it may include attachment and then its status should be approved b4 it can b displayed.

    I'm using your approuch to hide status column from user and I want status column to b visible only by approver.

    Is there any possible and better way to meet the requirement.

    ReplyDelete
  30. Deepak

    When you customize the form at that time you can also attach the document to that new item.

    If it gives mesasage like "This form was customized not working with attachment" .
    Please refer this link Microsoft has released the solution for that.
    http://support.microsoft.com/default.aspx?scid=kb;en-us;953271&sd=rss&spid=11373

    You can add one javascript to check that weather that person is from "Approvers" group or not
    Please go through this link
    http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/c9bfad37-2367-408b-8f50-73f349fd85e2

    Depends on user you can make it visible or hidden.

    you can write a new webpart where all functionality is there depends on security.
    Add that webpart to new Customized form for NewItem and set that page when users click on new item .

    Hope this helps!!
    Disha Shah

    ReplyDelete
  31. Hi Disha,

    I am new to share point 2007,Can U please suggest me online materials to learn Share Point.How to customize the web pages in Share Point Designer.

    Thanks in advance...

    Jyothi Samreddy

    ReplyDelete
  32. Hi Jyothi

    Sharepoint itself is a big platform to learn.Webparts, Eventhandler, workflows etc.,

    You can download Sharepoint 2007 SDK and start learning.
    http://msdn.microsoft.com/en-us/office/aa940989.aspx
    http://office.microsoft.com/en-ca/training/CR010214608.aspx

    I wish if you go with sharepoint 2010 , because this is the latest technology available in the market.
    During your learning, if you stuck anywhere , leave a comment.

    Thanks
    Disha Shah

    ReplyDelete
  33. Hi Disha

    I am not understanding from where to start to learn SharePoint from ur links.I am unable to open videos in my company.Is there any other way
    can u please suggest....
    Here is the link which i had learned sharepoint 2007 basics
    http://www.sharepointhostingprovider.com/sharepoint-tutorials/
    As of now for our project i need 2007 version only.
    now i need to customize some of the pages.
    can u please send me some links so that i can learn easily for both 2007 and 2010.

    Thanks in advance
    Jyothi Samreddy

    ReplyDelete
  34. Hi Jyothi

    The site that you have mentioned is seems good.

    You can follow same steps of my post to change SharePoint designer pages depends on your requirement.

    If you cannot ,please specify your case and I will provide you the solution.

    SharePoint itself is a big platform, Do one thing, take every part of sharepoint let us say start with lists, what is sharepoint?, eventhandler,webparts, workflows, etc.

    Take one topic and search so many msdn articles and other blogs are available, you can never find entire SharePoint content on one site.

    It is better way to go with one by one topic.

    Thanks
    Disha Shah

    ReplyDelete
  35. hi Hisha,

    what web service i can use to upload a file in sharepoint using java code?

    thanks
    Jyothi Samreddy

    ReplyDelete
  36. Hi Jyothi

    You can use the WSS "Copy.asmx" Web service to upload a document to a library.

    Here is a link which has given very nice descriptive example for Uploading a Document to the SharePoint Document Library using a Webservice.

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=297&AspxAutoDetectCookieSupport=1

    Thanks
    Disha Shah

    ReplyDelete
  37. Hi Disha

    Irrespective of language like java,dotnet,is there any webservice to upload a file in sharepoint.

    Thanks
    Jyothi Samreddy

    ReplyDelete
  38. Hi Jyothi

    The webservice ,"Copy.asms" is built in Sharepoint Webservice and to call that webservice you need some platform.

    Event to write custom webservice even you need platform or some framework.

    Which problem you are facing to call Sharepoint Built In Webservices?

    You want to use Webserive or finding some other way to do that?

    Thanks
    Disha Shah

    ReplyDelete
  39. Hi Disha

    thanks for ur response

    I didnt tried the solution u mentioned.I wanted to upload a file in sharepoint using java code for that which web service can i use.This task is not for me for my frnd,so i dont know exactly.

    if i will use Copy.asmx,it will work?

    or is there any web service which i can use java.

    ignore it if u cant get the question....

    thanks a lot
    Jyothi Samreddy

    ReplyDelete
  40. Hi Jyothi

    I got your question, your friend wants to call Webservice from Java.

    Please go through these Links

    Call Webservice From JAVA
    http://www.ibm.com/developerworks/webservices/library/ws-javaclient/index.html
    http://www.codeproject.com/KB/java/edujini_webservice_java.aspx

    Call Webservice From JavaScript
    http://www.codeproject.com/KB/webservices/CallWebServiceFromHtml.aspx

    Hope this helps to your friend
    Disha Shah

    ReplyDelete
  41. Hello Disha,

    Following the example you gave us I've created the EditForm2.aspx and set it as the Edit Item Form of my List. It works fine but when the customer changes the list and creates a new column, this new column doesn't appear in the EditForm2, just in the default EditForm. Is there any way to make these changes in the list reflect automaticaly in the customized form(EditForm2)?

    Thanks in advance.
    Felipe

    ReplyDelete
  42. Hello Felipe

    if you add another column to your Library or List it won’t be automatically loaded into your custom form.

    You need to reopen the page within Designer and add the column, just as you did when you created the form originally.

    Sorry, SharePoint Designer does not support this automatically

    Thanks
    Disha Shah

    ReplyDelete
  43. Hello Disha,

    This is an excellent post but I have one requirement that I am not sure how to fulfill. I have to make a field read-only based on the permissions. This field should be editable for users of SharePoint Group A but it should be read-only for users of SharePoint Group B.

    Do you have an idea how this requirement can be fulfilled?

    Thanks,
    Ricky

    ReplyDelete
    Replies
    1. Hi Ricky

      Yes you could fulfill your requirement via below jquery code which you need to add in "Content Editor Webpart".

      Here is the code
      $(document).ready(function () {
      $().SPServices({
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function (xData, Status) {
      //Shows the XML returned from the server
      if ($(xData.responseXML).find("Group[Name='Groupname']").length == 1)
      {

      //do not do anything as user inside the group so user has permsission
      }
      else
      {
      $("input[title='Title']").attr("readonly","true");
      }


      }

      });

      });

      Hope this helps and let me know if you still have any issue to achieve this.

      Thanks!
      Disha Shah

      Delete
    2. Hey Disha,

      Thank You for your quick response. I added the jquery in the CEWP but when I login with the ID that should see that field as "Read-only" (SharePoint Group B in above example). I actually see this error in all the webparts on that page "Access denied. You do not have permission to perform this action or access this resource".

      In your above example, I have changed the following:

      1. Added Group Name for the one that has permissions by subsituting Groupname in your example.
      2. Changed Title to the field name that should be readonly.

      Do I need to make any other change as you see it?

      Thanks once again,
      Ricky

      Delete
    3. Here's the code that I am running (removed the script tags to make sure the comment is published):

      script type="text/javascript" src="/jquery/js/jquery-1.3.2.js"
      script language="javascript" type="text/javascript" src="/jquery/js/jquery.SPServices-0.7.2.js"

      $(document).ready(function () {
      $().SPServices({
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function (xData, Status) {
      //Shows the XML returned from the server
      if ($(xData.responseXML).find("Group[Name='Chief Engineers']").length == 1)
      {
      //do not do anything as user inside the group so user has permsission
      }
      else
      {
      $("input[title='Verified']").attr("readonly","true");
      }

      }
      });
      });

      Delete
    4. Hi Ricky

      Does your Jquery library as well as the list has permission setup correctly? Every user must have read permsissions.

      Disha Shah

      Delete
    5. Hi Disha,

      Giving "Read" permissions resolved that issue but the "Verified" field is not being read-only for other groups. Do you know if it's possible that using an older version of jQuery (jquery-1.3.2.js) maybe causing this issue? It seems that the jQuery is not running and so not implementing the above functionality.

      Thanks,
      Ricky

      Delete
    6. Hi Ricky

      1.Use this Jquery to disable field
      $("input[Title='Verified']").attr("disabled", "");

      Or

      2. Please visit my this blog to use javascript to make it disable
      http://dishasharepointworld.blogspot.com/2011/08/read-only-field-in-sharepoint.html

      Let me know still you have any issue

      Thanks
      Disha Shah

      Delete
    7. Ricky

      I forgot add this attibute value if you would like to disable field from JQuery

      $("input[Title='Verified']").attr("disabled", "disabled");

      Let me know it works or not.

      Thank You!
      Disha Shah

      Delete
    8. Hi Disha,

      It still doesn't disable the 'Verified' field. I tried both jQuery that you mentioned above. The javascript solution in your blog may work but one of my requirement is to make the field read-only based on the SharePoint group.

      Is there a way to test if my jQuery is even running?

      Thanks a lot for all your insights.

      Ricky

      Delete
    9. Ricky

      If possible please download jquery-1.7.2 version online and try.

      To check wether your jquery is working or not, please add the alert dialog box as shown below! If it pops up, it is working.

      if ($(xData.responseXML).find("Group[Name='Chief Engineers']").length == 1)
      {
      alert('User in group');
      }
      else
      {
      alert('User Not in group');
      $("input[title='Verified']").attr("disabled","disabled");
      }

      I see script tag is missing on your code after you refer the Jquery files and before document.ready function

      Here is the final script.

      script type="text/javascript" language="javascript" src="/JQuery/jquery-1.7.2.js" /script
      script type="text/javascript" language="javascript" src="/JQuery/jquery.SPServices-0.7.1a.js" /script
      script language="javascript" type="text/ecmascript"

      $(document).ready(function () {
      $().SPServices({
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function (xData, Status) {
      //Shows the XML returned from the server
      if ($(xData.responseXML).find("Group[Name='Chief Engineers']").length == 1)
      {
      //do not do anything as user inside the group so user has permsission
      }
      else
      {
      $("input[title='Verified']").attr("disabled","disabled");
      }

      }
      });
      });

      /script

      Thanks
      Disha Shah

      Delete
    10. Hi Disha,

      Sorry for replying after such a long time but the alert dialog box is not working, so next thing I am going to try is update the jQuery version and try again. I have added this CEWP below the web part which has the field "Verified" that needs to be disabled. Does it matter where the CEWP is added in that web part zone, like does it have to be right below or above that webpart?

      Sorry for bothering you with this but my project is due soon and this is an important functionality that we need implemented.


      Thanks and Regards,
      Ricky

      Delete
    11. Hi Disha,

      jQuery is now running (Thanks for your help on that). I have also updated the jQuery to the one you recommended but the "Verfied" field is still not getting disabled for users not in that group.

      There are other webparts on the page. I added this CEWP with jQuery beneath the webpart where I want the field to be disabled. Like is their a way I can specifically mention in jQuery to look into this webpart and disable that particular field.

      Thanks,
      Ricky

      Delete
  44. I forgot to mention that the "Verified" field is a checkbox. Does it change the $("input[title='Verified']").attr("disabled","disabled"); line in the code?

    ReplyDelete

  45. Hi Ricky

    The line is correct. let us try with Javascript!
    Delete this line "$("input[title='Verified']").attr("disabled","disabled"); line in the code?"

    Copy the below 3 lines in place of the line which we deleted to disable the field
    Var controlVerified = getTagFromIdentifierAndTitle("input","BooleanField","IsPercent");
    alert(controlVerified);
    controlVerified.disabled ="disabled";

    And write the below javascript before document.ready function
    function getTagFromIdentifierAndTitle(tagName, identifier, title)
    {
    var len = identifier.length;
    var tags = document.getElementsByTagName(tagName);
    for (var i = 0; i < tags.length; i++)
    {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len))
    {
    return tags[i];
    }
    }
    return null;
    }


    Let me know still it is not working!

    Thanks
    Disha Shah

    ReplyDelete
  46. Hi Disha,

    It's working now. Thanks for all your help. I really appreciate it. You have a really great blog here with lots of helpful posts and its commendable that you take your personal time to reply to all the queries.

    Thanks again,
    Ricky

    ReplyDelete
  47. Hi Disha,

    A quick question, I have added another Verified2 checkbox field in the form and as per the jQuery I have disabled the field for a different Group. The issue that I am getting is that now that there are two checkboxes that get disabled for different groups, if I check Verified and then login as another user and check Verified2, Verified loses its check because of that.

    Is Verified losing it's checkmark because it is disabled even though it was checked previously? Is there a solution for this issue?

    Thanks,
    Ricky

    ReplyDelete
  48. FYI: I found the solution. I am using this line in the code to make the checkbox read-only:

    $("input[Title='Verified']").click(function(){return false;});

    ReplyDelete
    Replies
    1. Ricky

      Perfect!! I learned something new today from you!

      Thanks
      Disha Shah

      Delete
  49. The page you have selected does not reference the correct List... I backed up my pages.. but now I can't get any Document on my edit pages to work... OMG please help!!!!

    ReplyDelete
    Replies
    1. Hi

      This is working solution may be you missed some step! will you try to follow these steps and let me know still the problem occurs or not?

      1. Click on supporting files.
      2. Choose “Item” option value from the “Content Type specific items” section and then browse to your new form and assigned into NEW/EDIT Item form

      Thanks
      Disha Shah

      Delete
  50. Hi there, I'm trying to do this in SPD 2010, and am having many issues. First how to copy a form to edit, the right click option isn't available. Next, not sure where or how to implement the code. Do I have to edit in Advanced mode? Still having issues with that as well. Please help! Thanks!

    ReplyDelete
  51. Hi Disha
    This was very useful blog. Thanks a lot.
    Is is possible to pull in information across different lists which is part of another subsite. For Ex : Retrieve Employee Name based upon Employee ID which is saved in Employee Sub Site into the Travel Sub site.

    ReplyDelete
    Replies
    1. Yes Sandeep, By using Jquery SPServices.GetListItems you can achieve it.

      Let me know if you need any other information regarding SPServices.GetListListItems.

      Thanks
      Disha Shah

      Delete