Background Color

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlrZQ==?=, Nov 17, 2004.

  1. Hi,

    I have the following javascript that should change the background color of
    an element in a table:

    script.Append("document.getElementById(selectedDateId).style.backgroundColor
    = \"#00008b\"; \n");
    script.Append("document.getElementById(selectedDateId).className =
    \"AIMSSelectedDay\"; \n");

    However, the color is never changed. I tried to put some "alert" statement
    to see whether the function is accessed, and it is. Am I doing something
    wrong?

    Thanks.
    Mike
     
    =?Utf-8?B?TWlrZQ==?=, Nov 17, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?TWlrZQ==?=

    Karl Seguin Guest

    Is there a javascript error? (use fireforx and type javascript: to see
    errors).

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Mike" <> wrote in message
    news:...
    >
    > Hi,
    >
    > I have the following javascript that should change the background color of
    > an element in a table:
    >
    >

    script.Append("document.getElementById(selectedDateId).style.backgroundColor
    > = \"#00008b\"; \n");
    > script.Append("document.getElementById(selectedDateId).className =
    > \"AIMSSelectedDay\"; \n");
    >
    > However, the color is never changed. I tried to put some "alert" statement
    > to see whether the function is accessed, and it is. Am I doing something
    > wrong?
    >
    > Thanks.
    > Mike
    >
    >
     
    Karl Seguin, Nov 17, 2004
    #2
    1. Advertising

  3. No javascript error.



    "Karl Seguin" wrote:

    > Is there a javascript error? (use fireforx and type javascript: to see
    > errors).
    >
    > Karl
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    >
    >
    > "Mike" <> wrote in message
    > news:...
    > >
    > > Hi,
    > >
    > > I have the following javascript that should change the background color of
    > > an element in a table:
    > >
    > >

    > script.Append("document.getElementById(selectedDateId).style.backgroundColor
    > > = \"#00008b\"; \n");
    > > script.Append("document.getElementById(selectedDateId).className =
    > > \"AIMSSelectedDay\"; \n");
    > >
    > > However, the color is never changed. I tried to put some "alert" statement
    > > to see whether the function is accessed, and it is. Am I doing something
    > > wrong?
    > >
    > > Thanks.
    > > Mike
    > >
    > >

    >
    >
    >
     
    =?Utf-8?B?TWlrZQ==?=, Nov 17, 2004
    #3
  4. =?Utf-8?B?TWlrZQ==?=

    Karl Seguin Guest

    I ask because the javascript looks fine, all I can think of is that
    selectedDateId isn't a valid identifier..:

    I imagine you are actually doing something like:
    getElementById(\"" + selectedData.UniqueId + "\")...

    OR

    selectedDataId is an actual JS variable which you hopefully properly assign
    before this code executes..

    Karl


    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Mike" <> wrote in message
    news:...
    >
    > No javascript error.
    >
    >
    >
    > "Karl Seguin" wrote:
    >
    > > Is there a javascript error? (use fireforx and type javascript: to see
    > > errors).
    > >
    > > Karl
    > >
    > > --
    > > MY ASP.Net tutorials
    > > http://www.openmymind.net/
    > >
    > >
    > > "Mike" <> wrote in message
    > > news:...
    > > >
    > > > Hi,
    > > >
    > > > I have the following javascript that should change the background

    color of
    > > > an element in a table:
    > > >
    > > >

    > >

    script.Append("document.getElementById(selectedDateId).style.backgroundColor
    > > > = \"#00008b\"; \n");
    > > > script.Append("document.getElementById(selectedDateId).className =
    > > > \"AIMSSelectedDay\"; \n");
    > > >
    > > > However, the color is never changed. I tried to put some "alert"

    statement
    > > > to see whether the function is accessed, and it is. Am I doing

    something
    > > > wrong?
    > > >
    > > > Thanks.
    > > > Mike
    > > >
    > > >

    > >
    > >
    > >
     
    Karl Seguin, Nov 17, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mason66
    Replies:
    0
    Views:
    437
    mason66
    Jul 27, 2006
  2. JWL
    Replies:
    4
    Views:
    611
    Michael Winter
    Sep 26, 2006
  3. fig000
    Replies:
    0
    Views:
    4,590
    fig000
    Sep 6, 2004
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    503
    Kamaljeet Saini
    Feb 13, 2009
  5. Replies:
    1
    Views:
    312
    marss
    Feb 14, 2007
Loading...

Share This Page