in an list/EditForm.aspx, I have the following code to copy/paste a field to another place:

var dest = $('span[title="MyTitle"]').parents("tr:first"); // place to be copied
var source = $("input[id*='IsPositive']").parent(); // what to copy
dest.append('<td><span id = "NewIsPositivePosistion"> &nbsp;&nbsp;&nbsp; positive :&nbsp;&nbsp; '+ source.html() + "</span></td>") //append it
source.parents("tr:first").remove() // delete the old place

The field and its value is been copied but when i change the copied's value and press Save, its value is not been saved. Any ideas?

  • Might be due to Microsoft approach for value handling. Maybe data is extracted via some combination with DOM element path - by altering that, SP methods no more can find values (I do not know for sure - just guessing). Have You considered achieving results with CSS only? – Kristaps Vilerts Jun 14 '19 at 11:30

Instead of running jQuery to move columns around, you can use SharePoint Designer to create a 'new' EditForm.aspx

When you create a new Edit Form from SharePoint Designer, it will give you the full HTML/ASPX of that page with the HTML for the columns on your current EditForm.aspx. Then you can copy and paste the html snippet for each question in whatever order you'd like.

This way you will not be restricted to JavaScript being executed after your load, and will not need to maintain any specific JS or CSS.

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.