473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Set default TextArea text dynamically using returned ResultSet value

I have been trying to set the default text value of a TextArea element
for about a day now without any luck.

Similar to the code used to set the Text field below I would like to
use the returned (for lack of a better term) value in a TextArea
element ie. {TITLE}.
this works:
<input readonly="true" value="{TITLE}" name="titleedit"
size="50"
maxlength="255" class="detaileditentry">

But of course there is no "value" attribute for a TextArea element.
I've tried embedding a "value" between the
<textarea...>{DESCRIPTION}</textarea> but that gives me the string
literal.

I've tried using JavaScript to set the
document.input.descriptionedit.value value but this has to be done at
the "onload" point and of course the {DESCRIPTION} has no value at
that point until a LOAD_REQUEST is made (after the onload call).

Again, this is something I want to set at load time and therefore
can't use the "onclick" or similar event to set this value.

Does anyone know a trick to setting this type of element in this
manner?

Thanks,
Dave Kern
Jul 20 '05 #1
4 11171
de****@tallysystems.com (dekern) wrote:
I have been trying to set the default text value of a TextArea element
for about a day now without any luck.
In HTML terms that is easy.
I've tried embedding a "value" between the
<textarea...>{DESCRIPTION}</textarea> but that gives me the string
literal.


What do you mean by 'string literal'?
The above should display {DESCRIPTION} in the textarea, isn't that
what you want?

I think you need to explain exactly what you want.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2


dekern wrote:
I have been trying to set the default text value of a TextArea element
for about a day now without any luck.

Similar to the code used to set the Text field below I would like to
use the returned (for lack of a better term) value in a TextArea
element ie. {TITLE}.
this works:
<input readonly="true" value="{TITLE}" name="titleedit"
size="50"
maxlength="255" class="detaileditentry">

But of course there is no "value" attribute for a TextArea element.
I've tried embedding a "value" between the
<textarea...>{DESCRIPTION}</textarea> but that gives me the string
literal.

I've tried using JavaScript to set the
document.input.descriptionedit.value value but this has to be done at
the "onload" point and of course the {DESCRIPTION} has no value at
that point until a LOAD_REQUEST is made (after the onload call).

Again, this is something I want to set at load time and therefore
can't use the "onclick" or similar event to set this value.

Does anyone know a trick to setting this type of element in this
manner?


Your subject line talking about a "ResultSet" and the syntax
value="{TITLE}"
suggest you are using some data binding feature that is not part of
HTML. Maybe you can elaborate where that ResultSet comes from and
where/how you expect the TITLE replacement to happen, on the server or
on the client.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3
Martin Honnen <ma*******@yahoo.de> wrote in message news:<3f********@olaf.komtel.net>...
dekern wrote:
I have been trying to set the default text value of a TextArea element
for about a day now without any luck.

Similar to the code used to set the Text field below I would like to
use the returned (for lack of a better term) value in a TextArea
element ie. {TITLE}.
this works:
<input readonly="true" value="{TITLE}" name="titleedit"
size="50"
maxlength="255" class="detaileditentry">

But of course there is no "value" attribute for a TextArea element.
I've tried embedding a "value" between the
<textarea...>{DESCRIPTION}</textarea> but that gives me the string
literal.

I've tried using JavaScript to set the
document.input.descriptionedit.value value but this has to be done at
the "onload" point and of course the {DESCRIPTION} has no value at
that point until a LOAD_REQUEST is made (after the onload call).

Again, this is something I want to set at load time and therefore
can't use the "onclick" or similar event to set this value.

Does anyone know a trick to setting this type of element in this
manner?


Your subject line talking about a "ResultSet" and the syntax
value="{TITLE}"
suggest you are using some data binding feature that is not part of
HTML. Maybe you can elaborate where that ResultSet comes from and
where/how you expect the TITLE replacement to happen, on the server or
on the client.


I use JDBC ODBC to retrieve record sets from a database. I then
"push" the data into an XSL file for display purposes. Inside the XSL
I have a template defined that displays the returned record
information. Often this information is static and displayed in a
TABLE.

In cases where I am simply trying to display data I use syntax like
such:

<xsl:for-each select="/Report/DeviceList/Device">
<xsl:if test="SYSTEMDESCRIPTION">
<TD class="datadata">
<SPAN>
<xsl:value-of select="SYSTEMDESCRIPTION"/>
</SPAN>
</TD>
</xsl:if>
</xsl:for-each>

where SYSTEMDESCRIPTION is a column returned in the ResultSet of the
database query.

What is different here is that I am trying to access the value of the
DESCRIPTION column of a returned record and seed it into the TextArea
element so a user can modify the text.

As you can tell my HTML/XSL is very weak and perhaps I have posted to
the wrong group - if so, sorry and could someone point me to a group
that could possibly answer my question

Dave
Jul 20 '05 #4
de****@tallysystems.com (dekern) wrote in message news:<5f**************************@posting.google. com>...
Martin Honnen <ma*******@yahoo.de> wrote in message news:<3f********@olaf.komtel.net>...
dekern wrote:
I have been trying to set the default text value of a TextArea element
for about a day now without any luck.

Similar to the code used to set the Text field below I would like to
use the returned (for lack of a better term) value in a TextArea
element ie. {TITLE}.
this works:
<input readonly="true" value="{TITLE}" name="titleedit"
size="50"
maxlength="255" class="detaileditentry">

But of course there is no "value" attribute for a TextArea element.
I've tried embedding a "value" between the
<textarea...>{DESCRIPTION}</textarea> but that gives me the string
literal.

I've tried using JavaScript to set the
document.input.descriptionedit.value value but this has to be done at
the "onload" point and of course the {DESCRIPTION} has no value at
that point until a LOAD_REQUEST is made (after the onload call).

Again, this is something I want to set at load time and therefore
can't use the "onclick" or similar event to set this value.

Does anyone know a trick to setting this type of element in this
manner?


Your subject line talking about a "ResultSet" and the syntax
value="{TITLE}"
suggest you are using some data binding feature that is not part of
HTML. Maybe you can elaborate where that ResultSet comes from and
where/how you expect the TITLE replacement to happen, on the server or
on the client.


I use JDBC ODBC to retrieve record sets from a database. I then
"push" the data into an XSL file for display purposes. Inside the XSL
I have a template defined that displays the returned record
information. Often this information is static and displayed in a
TABLE.

In cases where I am simply trying to display data I use syntax like
such:

<xsl:for-each select="/Report/DeviceList/Device">
<xsl:if test="SYSTEMDESCRIPTION">
<TD class="datadata">
<SPAN>
<xsl:value-of select="SYSTEMDESCRIPTION"/>
</SPAN>
</TD>
</xsl:if>
</xsl:for-each>

where SYSTEMDESCRIPTION is a column returned in the ResultSet of the
database query.

What is different here is that I am trying to access the value of the
DESCRIPTION column of a returned record and seed it into the TextArea
element so a user can modify the text.

As you can tell my HTML/XSL is very weak and perhaps I have posted to
the wrong group - if so, sorry and could someone point me to a group
that could possibly answer my question

Dave


I figured it out - the above code does work in the
<textarea><xsl:value-of select="SYSTEMDESCRIPTION"/></textarea>
format, as long as you spell the tag correctly!

Thanks for any and all posts.
Dave Kern
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
4
by: Simon | last post by:
I have another question.. Let's take a textarea with the parameter: "rows=4" (<textarea rows=4 onkeydown="CheckScrollbar()"> ) If you start typing the scrollbar at the right is not active. Only...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
8
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in...
3
by: zjw2112 | last post by:
Hello. I have some javascript code that dynamically creates a textarea and sets the wrap value to hard, which I thought would preserve CR/LF in the textarea: var otherTextArea =...
1
by: chrisdr | last post by:
I found this code in a previous post but I am not able to get this to work for me... I am trying to dynamically change an element's type from textbox to textarea with an event. Actually in my code...
1
by: jb5531 | last post by:
Hello everyone! I am trying to implement some code for my website using JavaScript and DOM. The issue I'm having is that I want to change the size of the textarea on blur. This text area changes...
6
by: lamp | last post by:
Hello, I want 1 Textarea which can take only 20 characters. It can't input more than 20 characters. Please, guide me. Thanks in advance
20
by: Tony B | last post by:
I'm learning a little about using forms in php to enter data, and have a couple of questions re textarea. At the moment I just use "addslashes() to process the value from textarea so that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.