Results 1 to 2 of 2

Thread: Oh Dear...Button Properties problem

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Unhappy

    Back once again...
    Code:
    <TR><INPUT TYPE="button" NAME="About"   VALUE="ABOUT ME" _
    STYLE="HEIGHT:35px; WIDTH:120px; BORDER:0; _
    BACKGROUND=Transparent" TR<>
    is one of my tabel columns (I know this bit is correct). I then have a VBScript code using the About_OnMouseMove property to make a change to this. If I use the :
    Code:
    Private Sub About_OnMouseMove
    	Document.Frm_MenusLeft.About.Value = "I've Been Changed!"
    End Sub
    this works! However, if I call some of the other properties, which were recognised as working when the page loads, there is an error - the end part is not recognised :

    Code:
    Private Sub About_OnMouseMove
        Document.Frm_MenusLeft.About.STYLE="HEIGHT:50px; _
        WIDTH:150px; BORDER:1; BACKGROUND=LightYellow"
    End Sub
    Can someone please tell me why this is playing up? :Confused:
    Thank you in advance!

    [Edited by alex_read on 10-05-2000 at 09:44 AM]

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Ok... first off, you need a TD tag in your table. The browser is still displaying it without errors because they are designed to do a "best guess" as to what was intended with unclosed tags and missing tags but no data belongs inside of a TR tag alone. TR tags only define the row not the data in the row (in this case your INPUT tag).

    Second, the underscore is very handy in VB and VBScript, but not in the middle of a quoted string like you have here:

    Code:
    Private Sub About_OnMouseMove
        Document.Frm_MenusLeft.About.STYLE="HEIGHT:50px; _
        WIDTH:150px; BORDER:1; BACKGROUND=LightYellow"
    End Sub
    and third (and most importantly) you can't assign an inline style like that in script. Only through the Style attribute.

    Good news is, you can do what you are trying to do like this:

    Code:
    Sub About_OnMouseMove
        Frm_MenusLeft.About.style.height = "50px"
        Frm_MenusLeft.About.style.width = "150px"
        Frm_MenusLeft.About.style.border = 1
        Frm_MenusLeft.About.style.background = "LightYellow" 
    End Sub
    
    'Probably want to add this to return it to normal when the mouse moves away:
    Sub About_OnMouseOut
        Frm_MenusLeft.About.style.height = "35px"
        Frm_MenusLeft.About.style.width = "120px"
        Frm_MenusLeft.About.style.border = 0
        Frm_MenusLeft.About.style.background = "Transparent" 
    End Sub
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width