0

I want my list to take me to the edit form directly instead of the display form. I found this post (Change Title (linked to item with edit menu) to different column) and another that explains how to change the field that links but I want to open directly in the edit_form Modal window instead of the display form first? Thanks

2

Tick the "Edit item" field in the list view definition and don't use the "link to item with edit menu" or "link to item" for the title field. That way the user cannot click the item title to view the item. They can click the edit icon and the list item will open in Edit mode. No special code, no messing around. It's all in the box. Just tick the option.

| improve this answer | |
  • Teylyn, my list view is not using a title field in the view as I do not want it. Instead I'm using another field that I am asking the user to click on to edit the item. In SPD2010 I only have the option to 'Link to Item' or the 'list Menu'. If your method will still work I will give it a go but how to I find "Edit item" field in the list view definition? Thanks – JazzyN Sep 2 '15 at 10:23
  • Edit the view. The list of fields is presented alphabetically. Tick the box next to "Edit". Whether or not you have a Title field or another field for the ECB does not matter. You don't need the ECB. That's what my answer is about. Use the Edit icon in the view and don't use a link to the item. – teylyn Sep 2 '15 at 20:25
0

You can achieve this with Client Side Rendering too (CSR). I put this together for a tasks list so when the user clicks a task it goes directly to the edit form rather than the display form.

function CSR_Setup() {
    var overridectx = {};
    overridectx.Templates = {};
    overridectx.Templates.Fields = {
        "LinkTitle": { "View": CSR_EditTask }
    };
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overridectx);
}

function CSR_EditTask(ctx) {
    var fieldValue = ctx.CurrentItem.Title;
    var url = String.format('{0}&ID={1}', ctx.editFormUrl, ctx.CurrentItem.ID);

    return String.format('<a class="ms-listlink" href="{0}" onclick="EditLink2(this, 6);return false;" onfocus="OnLink(this) target="_self"">{1}</a>', url, fieldValue);
}

SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", CSR_Setup);

Place this JavaScript on your Display form, e.g. with a Content Editor webpart, and change the LinkTitle column in the code to whatever is the internal name of the column in your case.

| improve this answer | |
0

I'm assuming you have your list created and set up, and configured to launch forms in a dialog already, and all you need now is to default to the edit form?

The quick and easy way to do it using SharePoint Designer to change the default display form for your list to use EditForm.aspx instead. For SP Designer 2013, open your site and in the left hand menu navigate through to your list. On the list settings page, there's a section for content types, click on your content type to open the content type settings page. (if you have multiple content types you will need to repeat these steps for each one).

On the content type settings page you will see a "Forms" section, which you can use to specify what form to use for each action (Display, Edit, New). You want to specify to use the lists existing EditForm.aspx as the Display form. Just click where it says "Click here to enter text" and put in the path to your EditForm.aspx. This can be a relative path such as

/sites/sitename/Lists/ListName/EditForm.aspx

When done, save your changes. When you go to your list again in your browser and click on an item it should open in EditForm.aspx straight away.

| improve this answer | |
  • Hi. Sounds good but not sure if it'll will work. I am not using any of my own content types in the list. The only ones I can see are the Folder and Item defaults. As the item is set to default I went into the settings and have changed the display from to point to my edit form and then clicked save but my list still opens in the display form. – JazzyN Sep 2 '15 at 11:15
  • It should still work with the default item content types, I've tested with a list here an it works ok. – Steven Mulkerrins Sep 3 '15 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.