473,624 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

retrieve clean text between <td></td>

js
I have a table rendered with XSLT. The first column has a radio
button controls for user to make a selection for a particular row.
All the values in the remaining columns are all concated with a &#xA0;
(blank). I need to retieve the text in each cell of that row if the
radio button on that row is clicked. Each <TD> has a numeric ID so
that I can use it with document.getEle mentById().inne rText method. I
use Javascript to assign some hidden fields with these innerText
before the form is submitted. Upon submission, the form would contain
those values along with %90?. How can I get rid of those HTML encoded
string and get only the text that appear in the browser using
javascript? I am using IE6. I also need to have it working in Opera
and Netscape. Thanks.
Jul 23 '05 #1
2 11203
an********@yaho o.com (js) wrote in message news:<23******* *************** ****@posting.go ogle.com>...
I have a table rendered with XSLT. The first column has a radio
button controls for user to make a selection for a particular row.
All the values in the remaining columns are all concated with a &#xA0;
(blank). I need to retieve the text in each cell of that row if the
radio button on that row is clicked. Each <TD> has a numeric ID so
that I can use it with document.getEle mentById().inne rText method. I
use Javascript to assign some hidden fields with these innerText
before the form is submitted. Upon submission, the form would contain
those values along with %90?. How can I get rid of those HTML encoded
string and get only the text that appear in the browser using
javascript? I am using IE6. I also need to have it working in Opera
and Netscape. Thanks.


Can you post examples of the string you have and how
you'd like it to look afterwards? You can probably
do this pretty simply with a regular expression.

Shawn
Jul 23 '05 #2
Thanks for the reply. The following is the XSLT template that render the
table content, and Javascript that manipulate the values of the hidden
fields before submit. Thank you.

function fillTechRefresh Form()
{
var taskid = document.getEle mentById('txtTa skId').value;
if (taskid == "")
{
alert("Please select task id by clicking the radio button")
return false;
}
else
{
with (document.forms[0])
{
txtTaskId.value = document.getEle mentById('td' + taskid.toString () +
'1').innerText;
txtLastName.val ue = document.getEle mentById('td' + taskid.toString ()
+ '9').innerText;
txtFirstName.va lue = document.getEle mentById('td' +
taskid.toString () + '10').innerText ;
//cboUserName.val ue = document.getEle mentById('td' +
taskid.toString () + '2').innerText;
cboUserName.val ue = txtLastName.val ue + ", " + txtFirstName.va lue;
cboSerial.value = document.getEle mentById('td' + taskid.toString () +
'3').innerText;
txtScheduled.va lue = document.getEle mentById('td' +
taskid.toString () + '4').innerText;
txtReady.value = document.getEle mentById('td' + taskid.toString () +
'5').innerText;
txtDeployed.val ue = document.getEle mentById('td' + taskid.toString ()
+ '6').innerText;
txtNewSystem.va lue = document.getEle mentById('td' +
taskid.toString () + '7').innerText;
txtComments.val ue = document.getEle mentById('td' + taskid.toString ()
+ '8').innerText;
submit();
}
}
}

<!----XSLT---->
<xsl:when test="xyz/return/techrefreshs">
<xsl:if test="xyz/return/techrefreshs/recordcount = 0">
<div id="warning">N o record match the criteria.</div>
</xsl:if>
<xsl:if test="xyz/return/techrefreshs/recordcount &gt; 0">
<form action="techRef resh.asp" method="post"
onsubmit="retur n(fillTechRefre shForm())">
<table class="inventor yTable" cellpadding="0" cellspacing="0" >
<tr>
<th>&#xA0;</th>
<th><!--checkbox-->&#xA0;</th>
<th><a href="javascrip t:changeSort('o rg')" title="Order by
ORG">TASK ID</a></th>
<th><a href="javascrip t:changeSort('t icketnum')" title="Order by
user#">USER</a></th>
<th><a href="javascrip t:changeSort('t icketnum')" title="Order by
last name#">LAST NAME</a></th>
<th><a href="javascrip t:changeSort('t icketnum')" title="Order by
first name">FIRST NAME</a></th>
<th><a href="javascrip t:changeSort('c _last_name')" title="Order
by serial number">SERIAL</a></th>
<th><a href="javascrip t:changeSort('c _first_name')" title="Order
by scheduled date">SCHEDULED </a></th>
<th><a href="javascrip t:changeSort('t ype')" title="Order by ready
date">READY</a></th>
<th><a href="javascrip t:changeSort('s tatus')" title="Order by
deployed date">DEPLOYED</a></th>
<th><a href="javascrip t:changeSort('o pen_date')" title="Order by
system">NEW<br/>SYSTEM</a></th>
<th>COMMENTS</th>
</tr>
<xsl:apply-templates
select="xyz/return/techrefreshs/techrefresh"/>
</table>
<input type="hidden" id="txtTaskId" name="txtTaskId "/>
<input type="hidden" id="cboUserName " name="cboUserNa me"/>
<input type="hidden" id="txtLastName " name="txtLastNa me"/>
<input type="hidden" id="txtFirstNam e" name="txtFirstN ame"/>
<input type="hidden" id="cboSerial" name="cboSerial "/>
<input type="hidden" id="txtSchedule d" name="txtSchedu led"/>
<input type="hidden" id="txtReady" name="txtReady"/>
<input type="hidden" id="txtDeployed " name="txtDeploy ed"/>
<input type="hidden" id="txtNewSyste m" name="txtNewSys tem"/>
<input type="hidden" id="txtComments " name="txtCommen ts"/>
<input type="submit" id="btnAction" name="btnAction " value="Confirm
Selection"/>
</form>
</xsl:if>
</xsl:when>

<xsl:template match="techrefr esh">
<xsl:variable name="rowNumber " select="positio n()" />
<xsl:variable name="taskid" select="taskid"/>
<tr>
<td style="color:#C CC;background-color:#003366"> <xsl:value-of
select="$rowNum ber"/></td>
<td align="center">
<input type="radio" id="rdoSelected Task" name="rdoSelect edTask">
<xsl:attribut e name="value"><x sl:value-of
select="$taskid "/></xsl:attribute>
<xsl:attribut e
name="onclick"> document.getEle mentById("txtTa skId").value=<x sl:value-of
select="$taskid "/></xsl:attribute>
</input>
</td>
<td align="center">
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>1</xsl:attribute>
<xsl:value-of select="$taskid "/>
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>2</xsl:attribute>
<xsl:value-of select="userlog in"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>9</xsl:attribute>
<xsl:value-of select="lastnam e"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>10</xsl:attribute>
<xsl:value-of select="firstna me"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>3</xsl:attribute>
<xsl:value-of select="serial"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>4</xsl:attribute>
<xsl:value-of select="schedul ed"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>5</xsl:attribute>
<xsl:value-of select="systemr eady"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>6</xsl:attribute>
<xsl:value-of select="systemd eployed"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>7</xsl:attribute>
<xsl:value-of select="newsyst em"/>&#xA0;
</td>
<td>
<xsl:attribut e name="id">td<xs l:value-of
select="$taskid "/>8</xsl:attribute>
<xsl:value-of select="comment s"/>&#xA0;
</td>
</tr>
</xsl:template>


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

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

Similar topics

1
2523
by: Terry | last post by:
hi guys, could anyone help me with this? I tried to put a <div> in a <td>, and a <table> in that <div>. It looks fine, but my div can't fit in my <td>, there's always a space between the bottom of the <div> and the bottom of the <td>. I try to put margin-bottom:0 px to the <td>, <tr> also <table>, but there's still a space there. I need the div fit in the <td> totally. Could any one tell me how?
6
1724
by: Mel | last post by:
is it possible ? i tried size=100% and 'NADA !' thanks, Mel
3
8623
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample text</TD> <TD> not predefined font</TD></TR></TABLE>
3
2754
by: webserverpete | last post by:
I would like to have multiple <td> in a repeater control. The below code does not work: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" DataMember="DefaultView"> <HeaderTemplate> <table> </HeaderTemplate> <tr> <ItemTemplate> <td>
1
2219
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the pages "as is" in the new 2.0 app without using Master Pages or creating new ..aspx's. I'm looking for the quickest way to the finish line. Any suggestions would be welcomed. Thanks.
4
5253
George Lft
by: George Lft | last post by:
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea? <h4>Two rows and three columns:</h4> <table border="1"> <tr> <td>10000000000000</td> <td>200</td> <td>300</td> </tr> <tr>
7
2781
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why. $test=~/<tr><td>(.*)<\/td><\/td>(.*)<\/td><\/tr>/ms; <tr><td>station</td> <td>station number/identification, see chart above: <br> B = GoMoos buoy B location<br> S = New Scantum at the southern edge Jefferys Ledge</td></tr>.
2
2202
by: jessy | last post by:
I have a table at which i need to add fields in it whenever the user clicks on the Add button , here's my trial but seems sth is wrong : function AddTool() { formdiv = document.getElementById('1'); formdiv.innerHTML = formdiv.innerHTML +'<td align='center'><a href='#'><img border='0' src='../images/delete.gif'></td> '; } thats the Js function and thats the table which is generated through looping:
0
1838
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've created my table and alli is fine. I name my <tdtags to make them easier to identify when my table gets large. Anyway, I am naming as such: <td id="cellName" > Now, sometimes when make a change to a control my whole table gets resized and screwed up from some reason. I may have a column with a width of 75px, but it will appear so narrow it is hardly visible. Anyway, in these cases I undo what made this happen and the table fixes...
0
8174
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.