changing text box properties at runtime

Last post 05-17-2008 1:08 PM by mukiwa. 2 replies.

Sort Posts:

  • changing text box properties at runtime

    05-16-2008, 6:58 PM
    • Loading...
    • mukiwa
    • Joined on 05-15-2008, 1:46 PM
    • Posts 14

    I have a webpage with several text boxes.
    I want to change the looks of the textboxes based on certain events.
    The events happen to be hitting markers of a media file.

    I would like to change the background color and/or font size of certain text boxes when corresponding markers are hit.

    I figured out how the size of the text boxes, but that isn't what I want to do.

    <SCRIPT language = "JScript" for = Player1 event = markerHit(mymark)>
       if(mymark==1) Text.size = 5;
       if(mymark==2) Text.size = 10;
       if(mymark==3) Text.size = 20;
    </SCRIPT>


    I don't see individual properties for font and background color, only style, so I tried this:

    <SCRIPT language = "JScript" for = Player1 event = markerHit(mymark)>
       if(mymark==1) Text.style = "BACKGROUND-COLOR: aqua";
       if(mymark==2) Text.style = "BACKGROUND-COLOR: black";
       if(mymark==3) Text.style = "BACKGROUND-COLOR: blue";
    </SCRIPT>

    but the event throws "htmlfile: Member not found."

    I thought the properties visible for objects at design time could be changed at runtime. Works for size, but not for style.
    Thanks for any help.

  • Re: changing text box properties at runtime

    05-17-2008, 12:46 AM
    Answer
    • Loading...
    • SolaimalaiVT
    • Joined on 06-12-2007, 7:00 AM
    • India
    • Posts 73

    Hi, Instead of Text.style = "BACKGROUND-COLOR: aqua" Try This Text.style.backgroundColor = 'aqua'; Dont Forgot to Mark it as Answer if it is Helpful for you

    With Regards,
    Solaimalai V.T
  • Re: changing text box properties at runtime

    05-17-2008, 1:08 PM
    • Loading...
    • mukiwa
    • Joined on 05-15-2008, 1:46 PM
    • Posts 14

    That was so easy. Exactly what I was looking for.

    I'm quite new to this, so little problems like this one are burning lots of time.

    Thank you very much. 

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter