I am new to Sharepoint Online and was trying to insert data to sharepoint list from sharepoint page containing cotent editor web part but I guess there is some problemwith my code or something which is making web part uneditable after that.

Below is my code:


    <script type="text/javascript" src="login_javascript.js"></script>
        Name:<input type="text" name="name" id="name"><br>
        Email:<input type="email" name="email" id="email"><br>
        Password:<input type="password" name="password" id="password"><br>
        <input type="button" name="submit" value="Submit" onclick="loginSubmit()">



    function loginSubmit(){
alert("Form submitted");
var context=SP.ClientContext.get_current();
var listTitle="LoginForm1";
var login_form_list=context.get_web().get_lists().getByTitle(listTitle);
var ListItemCreationInformation=new SP.ListItemCreationInformation();
var listItem=login_form_list.addItem(ListItemCreationInformation);

var name=document.getElementById("name").value;
var email=document.getElementById("email").value;
var password=document.getElementById("password").value;
context.executeQueryAsync(AddListItemSucceeded, AddListItemFailed);  

function AddListItemSucceeded()  

function AddListItemFailed(sender, args)  
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());  

1 Answer 1


The Content Editor webpart is rendered in the BODY of a SharePoint page, therefore your code should not have HTML, Body, or HEAD elements. In addition, clocform is not a supported element.

You will likely need to delete this webpart from the page and recreate it. If the webpart delete controls are also broken, you can append a ?contents=1 to the end of the url, this will bring up a list of webparts that are on the page, rather than rendering them, from there you can delete the webpart, then return to the rendered page to Edit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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