0

I am using textbox to display the data being fetched from database , but sometime the data is long text .So for the user prospective it's not looking nice . Is there any other options to textbox . Suggestions or solutions needed .

Code i am using

HTML----

&nbsp;&nbsp;<div><div style="width:12%;float:left; margin-left:2%;" >Material</div> <div style="margin-left:15%;" id="serialno1" >Please Select </div></div><br />

Script----

$("#serialno1").html("<div style='margin: 10px; background-color:#CDD9E1;'>" + event.args.element.id + "</div>");

Right now i am not fetching data from db , will it possible to get data and display as what i am using now..

rahul
  • 7,573
  • 7
  • 39
  • 53
user1260967
  • 89
  • 1
  • 2
  • 14

3 Answers3

0

You could just use a <div> and apply some style to that to allow scrolling - it's an easier way to display read-only data and you can add or remove the scrolling ability as needed with CSS or manipulate with Javascript if needed.

CoderMarkus
  • 1,118
  • 1
  • 10
  • 24
  • Thnxs , is it possible to display the fetched data using this -- $('elementid').html(bla bla); – user1260967 Oct 17 '12 at 05:22
  • Definitely. Best way to do it IMHO. Plus you could add a little flair in there with some resizing or collapsing/expanding. Just throwin that out there. Have fun with it. – CoderMarkus Oct 17 '12 at 06:08
0

Try using text area instead of text box for longer text to display.

<textarea rows="4" cols="50">
Your text here
</textarea> 

you can customized the size of the text area by using the rows and cols attribute of the element.

Good luck!

Koy Bun
  • 201
  • 1
  • 6
0

you can use a <textarea>

More Information here

http://www.w3schools.com/tags/tag_textarea.asp

with <textarea> you can use this stylish plugin also

http://www.jacklmoore.com/autosize

or if you have only read only data i.e. no need of edit functionality use <div> apply some css and you are ready to do

you can set it's text or html property like this

$('#YourDivId').text('Your Text here');

or

$('#YourDivId').html('Your Text here');
rahul
  • 7,573
  • 7
  • 39
  • 53
  • yes for sure. if your data is in html format you can use .html('Your Text here') or it is simple text you can use .text('Your Text here') – rahul Oct 17 '12 at 06:26