Problems whit JavaScript

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
 
E

Eliyahu Goldin

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

Eliyahu
 
V

VKTOP

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
 
B

Bart

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top