Thanks you so much for the reply.Yes I am able to achive the Functionality.I am marking your Reply as answer.........Please can any one guide me of the problem as below.
In the same page I am also using a table to display some prices.I use to generate this table dynamically in the code behind of the aspx page.Here is the code which server sends to the client side
you can see 250.90 in the third last line.this price also comes at runtime(Now the problem is how can i use some variable or something else to reference this value becuse it can be 344 ,300 etc) .Now I want to change it to the same value i will calculate
using javascript value.i-e
In java script I will get the value from hidden input and then will proceed as follows
var txt = document.getElementById('<%=mytotalhidden.ClientID%>').innerHTML;
alert(
'value: '+txt);//to check what i am getting which is alway null
var temp=parseInt(txt);
txt=calculateTax(temp); //method to add some integer like 10 etc
alert('value: '+txt);
document.getElementById(
'<%=totalcharge.ClientID%>').innerHTML = txt;
now i want to get the position of 250.90 and replace with the value of txt variable .
nmeighty
Member
6 Points
44 Posts
Re: Accessing label value using javascript and then manipulating that value
Nov 21, 2007 10:47 AM|LINK
Hi ,
Thanks you so much for the reply.Yes I am able to achive the Functionality.I am marking your Reply as answer.........Please can any one guide me of the problem as below.
In the same page I am also using a table to display some prices.I use to generate this table dynamically in the code behind of the aspx page.Here is the code which server sends to the client side
<table width="95%" cellpadding="3" border="0" align="center">
<tr>
<td valign="top" class="TableBorder1">
<table id="ctl00_contentMain_priceTable" class="Table" border="0" style="width:100%;">
<tr id="ctl00_contentMain_TableHeaderRow13">
<th id="ctl00_contentMain_TableHeaderCell1" class="HeaderStyle33" colspan="6">Price Details</th>
</tr><tr id="ctl00_contentMain_TableRow1">
<td id="ctl00_contentMain_TableCell1"><span id="ctl00_contentMain_Labelins"><table id="mytable" width="500px" bordercolor="black" ><tr><td><b>Description</b></td><td><b>Quantity</b></td><td><b>Unit Price</b></td><td><b>Extended Price</b></td></tr><tr><td width="200px">Adult Price</td><td>1</td><td>199.00</td><td><strong>£199</strong></td></tr></br><tr><td width="200px">Price Adjustment</td><td>1</td><td>-35.00</td><td><strong>£-35</strong></td></tr></br><tr><td width="200px">Other Charges</td><td></td><td></td><td><strong>£86.90</strong></td></tr><tr><td></td><td></td><td></td><td><hr/></td></tr><tr><td width="200px">Total</td><td></td><td></td><td><strong>£250.90</strong></td></tr></table></span></td>
</tr>
</table>
you can see 250.90 in the third last line.this price also comes at runtime(Now the problem is how can i use some variable or something else to reference this value becuse it can be 344 ,300 etc) .Now I want to change it to the same value i will calculate using javascript value.i-e
In java script I will get the value from hidden input and then will proceed as follows
var txt = document.getElementById('<%=mytotalhidden.ClientID%>').innerHTML;alert(
'value: '+txt);//to check what i am getting which is alway null var temp=parseInt(txt);txt=calculateTax(temp); //method to add some integer like 10 etc
alert('value: '+txt);document.getElementById(
'<%=totalcharge.ClientID%>').innerHTML = txt;now i want to get the position of 250.90 and replace with the value of txt variable .
Please help .....
Thanks,
nmeighty