By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,734 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,734 IT Pros & Developers. It's quick & easy.

Set default TextArea text dynamically using returned ResultSet value

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a


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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.