• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

Load data form database by jsp and insert into something like textarea but show in html

hi, pro
I'm using jsp to load data from database and first I insert database into the textbox but my data include html code but the text box just show text only,
I want something look like textarea haven't the horiziontal but can show hyperlink and image
Could U help me
Something look like textbox but can show hyperlink also image, ...my data is load from database. Thanks U very much
0
stupidstudent06
Asked:
stupidstudent06
  • 3
  • 3
2 Solutions
 
suprapto45Commented:
Then you can't use textarea nor textbox. What I suggest you is that either create it by CSS or use Free HTML Editor such as tinyMCE - http://tinymce.moxiecode.com/

David
0
 
stupidstudent06Author Commented:
thank for your site, but I want do it by myseft, it'l take a lot of time to understand what the tool doing. I'll try to do this, thanks
0
 
tsewenCommented:
What would you like to have?  What do you mean you would like "something look like textarea haven't the horizontal"?  

If you want to get the HTML from database, and you want the HTML to take effect, then you should directly put it in the website rather than put it in a textbox or a textarea.  suprapto45 is right that you cannot use textarea nor testbox here.  Now, if you want something with borders, then you can use the div tag, as the link below shows.  Take a look at item #14.

http://www.gunn.palo-alto.ca.us/~pbruegger/projects/dhtml/dennis/page2.html

Now, you may not want the blue background and red borders and the text to align to the center.  Just change background-color and color to what you want and delete text-align.  For instance,

<DIV STYLE="position:absolute; top:50px; left:40px; width:400px; height:300px; background-color:blue; color:red; font-size:20; border:thin solid;"> [Insert text with jsp here] </DIV>

You can modify the positioning to whatever you would like.  I don't know what you want from the information you provided.

To delete the horizontal borders, you can use border-top and border-bottom instead of border.  So you would have

<DIV STYLE="position:absolute; top:500px; left:40px; width:400px; height:300px; font-size:20; border-top:thin solid; border-bottom: thin solid;"> [Insert text with jsp here] </DIV>

Note that the above line will give you background color of white and black borders on top and bottom, which is more like a textarea.

If you just want border on the top and border on the bottom, an easier solution below should work.  You essentially just put one line above the HTML code you want to insert and another line below.

<hr>
[Insert text with jsp here]
<hr>

Hope this helps.

Tom
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
stupidstudent06Author Commented:
Oh it's ok, but I want to show my product'sinformation that load form database, so the position changes for each of them.
If I use <div> tag, How can I make the position for <div> tag
I't a problem.
Thankx for your help
0
 
tsewenCommented:
I read the post again and realized I might have misread your post.  If you want borders on the left and right (instead of top and bottom), then you can use

<DIV STYLE="position:absolute; top:500px; left:40px; width:400px; height:300px; font-size:20; border-left:thin solid; border-right: thin solid;"> [Insert text with jsp here] </DIV>

If you want to change each position, you can modify the div tag.  Having position:absolute lets you specify exactly where in the browser you want your div block.  Modify the top, left, width, and height to get your desired position and size.
0
 
stupidstudent06Author Commented:
For every product ,if  I put <div> it in <td> of <table>
so when I load from database, if I have 20 product, the position of <div> must change for each?
I don't know how, so I check your advise,
thanks
0
 
tsewenCommented:
If you're using table, you can try something like this instead, which should be easier than recalculating the positions.

<html>
<table border="0">
<tr>
<td><DIV STYLE="width:400px; height:300px;font-size:20; border-left:thin solid; border-right:thin solid;"> [Insert text with jsp here] </DIV></td>
<td><DIV STYLE="width:400px; height:300px;font-size:20; border-right:thin solid;"> [Insert text with jsp here] </DIV></td>
</tr>
<tr>
<td><DIV STYLE="width:400px; height:300px;font-size:20; border-left:thin solid; border-right:thin solid;"> [Insert text with jsp here] </DIV></td>
<td><DIV STYLE="width:400px; height:300px;font-size:20; border-right:thin solid;"> [Insert text with jsp here] </DIV></td>
</tr>
</html>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now