Search code examples
jqueryjeditable

jeditable textbox width


is there anyway to make the textbox bigger than the text when using inline replace with jeditable. I want to give the user room to add new text on top of the existing text.


Solution

  • You can specify height and width in settings to set the textbox to specific height and width. There is also a function callback onedit which you can hookup to set specific size of edit box this did not work.

    <span id="edit">hello world!</span>
    
    <script type="text/javascript">
     $(document).ready(function(){
     $("span#edit").editable("....",
     {
                event: "click",
                style: "inherit",
                onblur: "submit",
                width:($("span#edit").width() + 200) + "px", // THIS DOES THE TRICK
                height:($("span#edit").height() + 100) + "px", //THIS DOES THE TRICK
                placeholder: "Click to set text",
                tooltip: "Click to update"
            });
       });
    </script>