How to show javascript funtion returns value to Label box?
-
Hi all, I have some java script code like this $8.18 AUD = $ currency_show_conversion(8.18,"AUD","CAD"); The output displays in form as 8.18 AUD= 17.23 CAD like this..... I need to get the values in to a label box,instead of the form.How can i display the values in Label Box.????if anybody having idea please suggest a solution.. Thanks in advance, Bijesh
-
Hi all, I have some java script code like this $8.18 AUD = $ currency_show_conversion(8.18,"AUD","CAD"); The output displays in form as 8.18 AUD= 17.23 CAD like this..... I need to get the values in to a label box,instead of the form.How can i display the values in Label Box.????if anybody having idea please suggest a solution.. Thanks in advance, Bijesh
bijeshputhalath wrote:
How can i display the values in Label Box.????
Is this for a web page (HTML)? If so there is no such thing as a "Label Box". You will have to learn HTML well enough to intelligently formulate your question if you want us to help you. For Learning HTML and Javascript try the tutorials at www.w3schools.com as a starting point.
led mike
-
bijeshputhalath wrote:
How can i display the values in Label Box.????
Is this for a web page (HTML)? If so there is no such thing as a "Label Box". You will have to learn HTML well enough to intelligently formulate your question if you want us to help you. For Learning HTML and Javascript try the tutorials at www.w3schools.com as a starting point.
led mike
Hi, Not in HTML Page.I need to show in aspx page . Thanks
-
Hi, Not in HTML Page.I need to show in aspx page . Thanks
bijeshputhalath wrote:
Not in HTML Page.I need to show in aspx page .
Wow, I thought I was in a different forum, my fault. :-O This asp.Label
<asp:Label ID="labelTest" runat="server" Text="Label"></asp:Label>
Becomes the following in the browser (you can see this by using the browsers "View Source" menu item)
<span id="labelTest">Label</span>
So for IE Browser (I don't know about a cross browser solution) the script would be:
document.getElementById("labelTest").innerText = "Hello World";
Keep in mind that ASP can alter names if they are nested inside ASP container controls so using the View Source is a way to determine that.
led mike
-
Hi all, I have some java script code like this $8.18 AUD = $ currency_show_conversion(8.18,"AUD","CAD"); The output displays in form as 8.18 AUD= 17.23 CAD like this..... I need to get the values in to a label box,instead of the form.How can i display the values in Label Box.????if anybody having idea please suggest a solution.. Thanks in advance, Bijesh
Labels are mostly rendered as SPANs and you can write on them using
.innerHTML
or.innerText
properties.Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
Hi, Not in HTML Page.I need to show in aspx page . Thanks
bijeshputhalath wrote:
Not in HTML Page.I need to show in aspx page
ASPX renders as HTML in the web browser. You mostly need to deal with SPANs, as I guided you in my other reply.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
Labels are mostly rendered as SPANs and you can write on them using
.innerHTML
or.innerText
properties.Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonHai, Thanks for your help.But how I get values in to Label or text box from that script funtion.If any sample code means it will be very helpful. Thanks and regards Bijesh
-
bijeshputhalath wrote:
Not in HTML Page.I need to show in aspx page .
Wow, I thought I was in a different forum, my fault. :-O This asp.Label
<asp:Label ID="labelTest" runat="server" Text="Label"></asp:Label>
Becomes the following in the browser (you can see this by using the browsers "View Source" menu item)
<span id="labelTest">Label</span>
So for IE Browser (I don't know about a cross browser solution) the script would be:
document.getElementById("labelTest").innerText = "Hello World";
Keep in mind that ASP can alter names if they are nested inside ASP container controls so using the View Source is a way to determine that.
led mike
Hai, Thanks for your continues help.How can I assign the script funtion returns value in to label or text box ? please give any sample codes. Thanks and regads Bijesh