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.

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);
| improve this answer | |
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" />
| improve this answer | |

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.