Llamar a procedimiento

18/05/2005 - 21:18 por Cris I. | Informe spam
Hola a todos, tengo un problema con un procedimiento que no puedo llamar
desde el evento onchange de un textbox...

el procedimiento es

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Validate
Dim TheForm
Set TheForm = Document.forms("ValidForm")
If IsNumeric(TheForm.Text1.Value) Then
If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
MsgBox "Please enter a number between 1 and 10."
Else
MsgBox "Thank you."
End If
Else
MsgBox "Please enter a numeric value."
End If
End Sub-->
</SCRIPT>

y trato de llamarlo de la siguiente forma:

<INPUT TYPE="text" NAME="text1" VALUE="." SIZE="10" contenteditable="false"
onchange="Validate()">

Espero que alguien pueda ayudarme.
Gracias.

Preguntas similare

Leer las respuestas

#1 Manuel Vera
18/05/2005 - 22:36 | Informe spam
prueba quitandole el texto
contenteditable="false"
a tu INPUT
Salu2
MV

"Cris I." wrote in message
news:
Hola a todos, tengo un problema con un procedimiento que no puedo llamar
desde el evento onchange de un textbox...

el procedimiento es

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Validate
Dim TheForm
Set TheForm = Document.forms("ValidForm")
If IsNumeric(TheForm.Text1.Value) Then
If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
MsgBox "Please enter a number between 1 and 10."
Else
MsgBox "Thank you."
End If
Else
MsgBox "Please enter a numeric value."
End If
End Sub-->
</SCRIPT>

y trato de llamarlo de la siguiente forma:

<INPUT TYPE="text" NAME="text1" VALUE="." SIZE="10"


contenteditable="false"
onchange="Validate()">

Espero que alguien pueda ayudarme.
Gracias.
Respuesta Responder a este mensaje
#2 Cris I.
18/05/2005 - 23:29 | Informe spam
Hola Manuel, gracias por contestar, fijate que sigue sin funcionar, me parece
que el problema está en la forma en que mando a llamar al procedimiento.

Saludos.

"Manuel Vera" escribió:

prueba quitandole el texto
contenteditable="false"
a tu INPUT
Salu2
MV

"Cris I." wrote in message
news:
> Hola a todos, tengo un problema con un procedimiento que no puedo llamar
> desde el evento onchange de un textbox...
>
> el procedimiento es
>
> <SCRIPT LANGUAGE="VBScript">
> <!--
> Sub Validate
> Dim TheForm
> Set TheForm = Document.forms("ValidForm")
> If IsNumeric(TheForm.Text1.Value) Then
> If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
> MsgBox "Please enter a number between 1 and 10."
> Else
> MsgBox "Thank you."
> End If
> Else
> MsgBox "Please enter a numeric value."
> End If
> End Sub-->
> </SCRIPT>
>
> y trato de llamarlo de la siguiente forma:
>
> <INPUT TYPE="text" NAME="text1" VALUE="." SIZE="10"
contenteditable="false"
> onchange="Validate()">
>
> Espero que alguien pueda ayudarme.
> Gracias.



Respuesta Responder a este mensaje
#3 Manuel Vera
19/05/2005 - 00:26 | Informe spam
1) El script completo lo tienes dentro de <HEAD>..</HEAD> ?
2) Prueba con esto otro: onchange="vbscript:Validate()">
3) Cual exctamente es el problema? Nunca parece entrar en la SUB?

Salu2
MV

"Cris I." wrote in message
news:
Hola Manuel, gracias por contestar, fijate que sigue sin funcionar, me


parece
que el problema está en la forma en que mando a llamar al procedimiento.

Saludos.

"Manuel Vera" escribió:

> prueba quitandole el texto
> contenteditable="false"
> a tu INPUT
> Salu2
> MV
>
> "Cris I." wrote in message
> news:
> > Hola a todos, tengo un problema con un procedimiento que no puedo


llamar
> > desde el evento onchange de un textbox...
> >
> > el procedimiento es
> >
> > <SCRIPT LANGUAGE="VBScript">
> > <!--
> > Sub Validate
> > Dim TheForm
> > Set TheForm = Document.forms("ValidForm")
> > If IsNumeric(TheForm.Text1.Value) Then
> > If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
> > MsgBox "Please enter a number between 1 and 10."
> > Else
> > MsgBox "Thank you."
> > End If
> > Else
> > MsgBox "Please enter a numeric value."
> > End If
> > End Sub-->
> > </SCRIPT>
> >
> > y trato de llamarlo de la siguiente forma:
> >
> > <INPUT TYPE="text" NAME="text1" VALUE="." SIZE="10"
> contenteditable="false"
> > onchange="Validate()">
> >
> > Espero que alguien pueda ayudarme.
> > Gracias.
>
>
>
Respuesta Responder a este mensaje
#4 Cris I.
19/05/2005 - 01:04 | Informe spam
"Manuel Vera" escribió:

1) El script completo lo tienes dentro de <HEAD>..</HEAD> ?



Sí está entre etiquetas de HEAD

2) Prueba con esto otro: onchange="vbscript:Validate()">



Tampoco con esto funciono

3) Cual exctamente es el problema? Nunca parece entrar en la SUB?



Así es Manuel, no entra al procedimiento y en la barra de estado aparece la
leyenda Error en la página.

En verdad no tengo la menor idea de cual pueda ser el error.


Salu2
MV

"Cris I." wrote in message
news:
> Hola Manuel, gracias por contestar, fijate que sigue sin funcionar, me
parece
> que el problema está en la forma en que mando a llamar al procedimiento.
>
> Saludos.
>
> "Manuel Vera" escribió:
>
> > prueba quitandole el texto
> > contenteditable="false"
> > a tu INPUT
> > Salu2
> > MV
> >
> > "Cris I." wrote in message
> > news:
> > > Hola a todos, tengo un problema con un procedimiento que no puedo
llamar
> > > desde el evento onchange de un textbox...
> > >
> > > el procedimiento es
> > >
> > > <SCRIPT LANGUAGE="VBScript">
> > > <!--
> > > Sub Validate
> > > Dim TheForm
> > > Set TheForm = Document.forms("ValidForm")
> > > If IsNumeric(TheForm.Text1.Value) Then
> > > If TheForm.Text1.Value < 1 Or TheForm.Text1.Value > 10 Then
> > > MsgBox "Please enter a number between 1 and 10."
> > > Else
> > > MsgBox "Thank you."
> > > End If
> > > Else
> > > MsgBox "Please enter a numeric value."
> > > End If
> > > End Sub-->
> > > </SCRIPT>
> > >
> > > y trato de llamarlo de la siguiente forma:
> > >
> > > <INPUT TYPE="text" NAME="text1" VALUE="." SIZE="10"
> > contenteditable="false"
> > > onchange="Validate()">
> > >
> > > Espero que alguien pueda ayudarme.
> > > Gracias.
> >
> >
> >



Respuesta Responder a este mensaje
#5 Manuel Vera
19/05/2005 - 14:38 | Informe spam
Twilight Zone!!!

Primero prueba con este cambio:

<INPUT TYPE="text" ID="text1" NAME="text1" VALUE="." SIZE="10"
onchange="Validate()">

Si no sirve, prueba con este otro:

<INPUT TYPE="text" ID="text1" NAME="text1" VALUE="." SIZE="10"
onchange="Validate(this.form)">

Coloque unos MsgBox "N" para saber hasta que parte del codigo este
funcionando.
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Validate(TheForm)
MsgBox "1"
Dim miValor
miValor = TheForm.Text1.value
MsgBox "2"
If IsNumeric(miValor) Then
MsgBox "3"
If miValor < 1 Or miValor > 10 Then
MsgBox "Please enter a number between 1 and 10."
Else
MsgBox "Thank you."
End If
Else
MsgBox "Please enter a numeric value."
End If
MsgBox "4"
End Sub
</SCRIPT>


Salu2
MV
Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaSiguiente Respuesta Tengo una respuesta
Search Busqueda sugerida