I have a requirement i want to auto-populate the text in the "Share on Your Newsfeed" textbox with some dynamic text. The background is we have a quiz and at the end of that we want user to share that on their newsfeed just like Facebook. We need a popup like below when we click on a button:

enter image description here

  • 1
    $('#ms-microbloginputbox').val('text here'); should work. Create a page with a newsfeed webpart. you can only show the textbox area using css. pass your dynamic string as parameter. read that string using "JSRequest" object or GetUrlKeyValue methods. execute $('#ms-microbloginputbox').val('text here'); inside _spBodyOnLoadFunctions.push(function(){$('#ms-microbloginputbox').val('pass dynamic text here');}) – Shekar Reddy Aug 6 '15 at 19:01

You can call below url in your Sp.UI.ModalDialog to open a popup with your custom message prefilled:


Main Query string paramenter is ArticleUrl=YourCustomText

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.