0

I've a SharePoint list, which created using OOTB function. In that list I need to add a button inside the form. So On click of that button will change the status(custom field). When I googled all i get is custom ribbon button. But I need button inside the form.

Alternatively if I can place that button next to "Save" & "Cancel" would be fine too..

enter image description here

Any help would be appreciated..

Updated

I've created new edit form using sharepoint designer. Where I've placed button & when clicking, it change the field value. But after that When I tried to save form using Save button, the modified value is getting updated on the field..

Button code:

<input type="button" value="Work Done" onclick="javascript: document.getElementById('tdItemStatus').innerHTML = 'Work Done';"/>

Thanks, Arun

1

It's quite simple actually. You need to open the list/document library in SharePoint designer, and on the right hand side you will find a group of files titled "Forms".

Create a new edit form or a new item form as per your requirement. The designer will generate a new aspx file which you would be able to edit, and place your button wherever you need. To set the value of your status field, you can run a bit of jQuery!

Note: I don't believe you can modify the default forms as the fields seem to be generated on-the-go by SharePoint. So you will need to create the new forms and then set them as the defaults.

  • could you please have a look into the updated question – Arun Feb 9 '16 at 17:22
  • Writing into the innerHtml would definitely not work. Try to find the input element inside tdItemStatus and write the status as its value. – Nisarg Feb 10 '16 at 1:49
  • Thanks for the clarification.. I've changed the InnerHTML to value & fields id. Now its working fine.. Also have one question can we hide those save & cancel button in the form level. I need those buttons enabled at Ribbon bar. But When I removed those buttons code from aspx files, It removes in ribbon bar too.. How to hide it without hiding on Ribbon bar? – Arun Feb 10 '16 at 14:02
  • Can you try hiding them through CSS? I am not sure if SharePoint let's you do this. – Nisarg Feb 11 '16 at 1:33
  • Thanks for your update.. I've hided it using following method on that <tr> tag <tr class="HideRow" style="display:none;"> – Arun Feb 11 '16 at 16:16
0

While on the edit form, click on the cog and then edit page. Now add a script editor webpart. You should be able to use jquery selectors to add a new button wherever you want. As far as changing the value in the OOTB field when they click your button, it really depends on what field type you're talking about. You can probably just use another jquery selector to change the value in a text box but if your field type is something more complicated then it is more difficult.

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.