Problems whit JavaScript

  • Thread starter Thread starter VKTOP
  • Start date Start date
V

VKTOP

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
 
What never runs? CambiarMayusculas? It looks ok. May be there is something
important that you don't mention.

Eliyahu
 
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
 
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.
 
Back
Top