View Full Version : Attributes changes using VB

03-21-2007, 09:52 PM
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?

03-21-2007, 10:04 PM
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;