Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 308
leora Avatar asked Sep 22 '09 04:09

leora


People also ask

How to set width of an input text box in JavaScript?

Set width of an input text box in HTML, CSS, and JavaScript 1 Set width in HTML In HTML, you can use the width attribute to set the width of an element. ... 2 Set width with CSS It is good practice to separate CSS from HTML markup. The idea is to define a class to set the width CSS property. ... 3 Set width with JavaScript

How to set the width of an element in JSFiddle?

In HTML, you can use the widthattribute to set the width of an element. 1 2 3 4 5 6 <html> <body> <label for="name">Enter a value:</label> <input type="text"id="name"style="width: 200px;"> </body> </html> Edit in JSFiddle Alternatively, you can also use the sizeattribute to define the width of the <input>.

How to set width of an element in HTML?

1. Set width in HTML. In HTML, you can use the width attribute to set the width of an element. Alternatively, you can also use the size attribute to define the width of the <input>. 2. Set width with CSS. It is good practice to separate CSS from HTML markup. The idea is to define a class to set width CSS property.


1 Answers

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>
like image 77
TheVillageIdiot Avatar answered Sep 28 '22 00:09

TheVillageIdiot