Problems whit JavaScript

Discussion in 'ASP .Net' started by VKTOP, Feb 15, 2005.

  1. VKTOP

    VKTOP Guest

    Hi friends!
    I have a problem
    i have a textbox in aspx webform:
    in the load event :
    txtNombre.Attributes.Add("onblur", "CambiarMayusculas(' txtNombre')")

    i have a javascript function :

    function CambiarMayusculas(elemento1) {var
    elem=document.getElementById(elemento1); if (elem.value!="")
    elem.value.Text.toUpperCase(); }

    but never run

    Thank

    Victor
    VKTOP, Feb 15, 2005
    #1
    1. Advertising

  2. What never runs? CambiarMayusculas? It looks ok. May be there is something
    important that you don't mention.

    Eliyahu

    "VKTOP" <> wrote in message
    news:...
    > Hi friends!
    > I have a problem
    > i have a textbox in aspx webform:
    > in the load event :
    > txtNombre.Attributes.Add("onblur", "CambiarMayusculas(' txtNombre')")
    >
    > i have a javascript function :
    >
    > function CambiarMayusculas(elemento1) {var
    > elem=document.getElementById(elemento1); if (elem.value!="")
    > elem.value.Text.toUpperCase(); }
    >
    > but never run
    >
    > Thank
    >
    > Victor
    >
    >
    Eliyahu Goldin, Feb 15, 2005
    #2
    1. Advertising

  3. VKTOP

    VKTOP Guest

    Hi Eliyahu, thank for response
    ok

    this :
    function CambiarMayusculas(elemento1) {
    var elem=document.getElementById(elemento1);
    if (elem.value!="")
    elem.value.Text.toUpperCase();
    } ---------No run


    this :
    function CambiarMayusculas() {
    var elem=document.getElementById('txtNombre');
    if (elem.value!="")
    elem.value.Text.toUpperCase();
    } -------- that ok and run

    Why?

    Thank for your help

    Victor

    "Eliyahu Goldin" <> wrote in message
    news:...
    > What never runs? CambiarMayusculas? It looks ok. May be there is something
    > important that you don't mention.
    >
    > Eliyahu
    >
    > "VKTOP" <> wrote in message
    > news:...
    > > Hi friends!
    > > I have a problem
    > > i have a textbox in aspx webform:
    > > in the load event :
    > > txtNombre.Attributes.Add("onblur", "CambiarMayusculas(' txtNombre')")
    > >
    > > i have a javascript function :
    > >
    > > function CambiarMayusculas(elemento1) {var
    > > elem=document.getElementById(elemento1); if (elem.value!="")
    > > elem.value.Text.toUpperCase(); }
    > >
    > > but never run
    > >
    > > Thank
    > >
    > > Victor
    > >
    > >

    >
    >
    VKTOP, Feb 15, 2005
    #3
  4. VKTOP

    Bart Guest

    The way i do Javascripts is to insert them in the aspx page itself using
    HTML editing mode, this works just fine sofar and even when adding
    attributes from the server side like in your example do not disturb the
    javascript i added in the designer.

    have you checked if the onblur="...." appears at all in the rendered HTML ?
    (view source from the browser)

    Bart.

    "VKTOP" <> wrote in message
    news:...
    > Hi friends!
    > I have a problem
    > i have a textbox in aspx webform:
    > in the load event :
    > txtNombre.Attributes.Add("onblur", "CambiarMayusculas(' txtNombre')")
    >
    > i have a javascript function :
    >
    > function CambiarMayusculas(elemento1) {var
    > elem=document.getElementById(elemento1); if (elem.value!="")
    > elem.value.Text.toUpperCase(); }
    >
    > but never run
    >
    > Thank
    >
    > Victor
    >
    >
    Bart, Feb 15, 2005
    #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. Edison
    Replies:
    0
    Views:
    335
    Edison
    Oct 2, 2003
  2. dolphin
    Replies:
    4
    Views:
    303
    James Kanze
    Mar 29, 2007
  3. Replies:
    13
    Views:
    538
    Wildemar Wildenburger
    Nov 12, 2007
  4. ownowl
    Replies:
    6
    Views:
    608
    Roedy Green
    Jul 11, 2009
  5. sahm
    Replies:
    4
    Views:
    856
Loading...

Share This Page