|
-
Apr 17th, 2005, 08:03 PM
#1
Thread Starter
Fanatic Member
asp:Label and Javascript
Hi,
This should be simple ... I want to determine the value of an asp:label control in a javascript function on the same aspx page
Code:
<script language="javascript">
function GetDecisionTreeValue(){
if (document.Form1.lblList.Value == 'Roles') {
window.open('RoleDecisionTree.aspx','Lookup','scrollbars=yes,resizable=yes,status=yes,width=600,height=250');
}
}
</script>
Any ideas?
Thx!
-
Apr 20th, 2005, 08:02 AM
#2
I wonder how many charact
Re: asp:Label and Javascript
if (document.getElementById('lblList').value == 'Roles')
First, you should use getElementById, it is the accepted standard for the transitional doctype.
Secondly, remember javascript is case sensitive - therefore value needs to be lowercase.
-
Apr 20th, 2005, 08:43 AM
#3
Thread Starter
Fanatic Member
Re: asp:Label and Javascript
nemaroller, thanks!
OneSource
-
Apr 20th, 2005, 11:24 AM
#4
Addicted Member
Thirdly,
Labels arent going to have values, they'll have innerText.
Code:
if (document.getElementById('lblList').innerText == 'Roles')
-
Apr 20th, 2005, 01:29 PM
#5
I wonder how many charact
Re: Thirdly,
 Originally Posted by WALDO
Labels arent going to have values, they'll have innerText.
Code:
if (document.getElementById('lblList').innerText == 'Roles')
Thanks for the reminder! lol
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|