1

I have two Content Editor Webparts in a page(CEWP) in a SharePoint page. In the first CEWP I have two html text boxes and one button. If i click on the button in first CEWP the second CEWP will display the result in page. How to concatenate and display the result.

2 Answers 2

0

Its not needed to use two CEWP, you can achieve it in a single CEWP itself. After your html textbox and buttons add a 'div' tag as below.

<div id="displayresults" />

On click event of your button, call a JavaScript function that will your results to the div like below,

var resultdiv = $("#displayresults");
var resultTable="<Your results in html format>";
$(resultTable).appendTo(resultdiv);
0

You should use ID in the HTML elements.

Example

first content editor

<input type="button" onclick="SetSecondC();" values="Click" />

function SetSecondC() {
    document.getElementById('txtSecond').value = "Message";
}

second content editor

<input type="text" id="txtSecond" />

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.