Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    117
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Attributes changes using VB

    OK, I guess my question is not only if is this possible, but should I do it an easier way. I think the most logical idea just came to mind as I started to write this.

    Here is my situation. I load a page that has 3 links on it - input, approval, review.

    Based on the person logging in, if it is both an approver and a reviewer, I am going to show all 3 links. If it is a reviewer only, I want to show the input and the reviewer, hide the approver link, and move the reviewer link up to where the approver link is hidden so that I don't have empty space between the 2 visible links.

    On my page load, I am doing a check for a querystring value to see who it is. If it's the reviewer only, I am trying to use "Me.LnkButton3.Attributes" to change the style attribute to reposition the link button on the page. It appears there is no easy way to do this.

    Am I better off setting a server side variable to something and then check that value in the HTML to determine what value to use for my "left" and "top" inside my style attribute?

    Example: ......."style=.....; top: <% if ReviewerOnly then 50 else 80 %>px; left: 50px ........

    What do you all think?

  • #2
    Regular Coder
    Join Date
    Jan 2007
    Posts
    117
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Figured it out myself

    I just used a JavaScript function on the body onload:

    function OnLoad(){
    var Reviewer = "<%=ReviewerOnly%>";

    if(Reviewer == "True"){
    window.document.getElementById("LnkBtnChks").style.top = 120;
    }
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •