Javascript Jive Ask Widget for 5.0

Version 2

     

    Use case:

     

    For Admin to provide a simple way for users to ask questions and post discussion inside a Jive widget. Use HTML widget in an overview page. NOTE: Doesn't include the search existing discussion feature.

     

    Visual:

     

    Screenshot-2013-05-31_14.10.37.png

     

    Code:

     

    <!---This script clears the text on the Text Field--->

    <script language="javascript">

    function cleartext(){

    input.value="";

    }

    </script>

     

     

    <a id="reflectedlink" href="https://yourjivesite.com/community/post!input.jspa?containerType=14&container=6744&subject="></a><br><center>

      

    <!---This code gets the input value from the Text box--->

    <input id="searchterm" size="25" value="Type your Question" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;"///>

    <br><br>

     

    <!---This code combines the given URL and adds the input value from the Text box---><input type='button' onclick="window.open(link.href+linkput)" value='Ask it!'>

    <input type='button' onclick='cleartext()' value='Clear'><br><p><br></p>

     

     

    <script type="text/javascript">

        var link= document.getElementById('reflectedlink');

        var input= document.getElementById('searchterm');

    var link2 = "&contentType=1";

        input.onchange=input.onkeyup= function() {

            linkput=(input.value);

            link.firstChild.data= link.href;

        };

    </script>

     

    Example:

     

    <a id="reflectedlink" href="https://yourjivesite.com/community/post!input.jspa?containerType=14&container=6744&subject=">


    • replace the HREF value to the URL of the discussion post in your community and add &subject= to the end.