Manoli01 de Septiembre del 2003
PreguntaHola a todos!
Tengo este codigo para que me corte trozos de un textarea pero me dice que se esperaba un objeto al darle al botón que llama a la función.
<script language="JavaScript" type="text/javascript">
function transformar()
{
cadena=form.txtIntroducir.value
Trim (cadena)
longitud = Len(cadena)
temp1 = InStr(cadena, "Cuenta de mayor facturación:")
strTemp = Left(cadena, temp1 - 4)
temp2 = InStr(strTemp, "NIF/CIF:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 8))
strTemp = Replace(strTemp, "NIF/CIF:", "")
NIF_CIF = LTrim(strTemp)
cadena = Right(cadena, longitud - temp1)
longitud = Len(cadena)
temp1 = InStr(cadena, "Contacto:")
strTemp = Left(cadena, temp1 - 3)
temp2 = InStr(strTemp, "Nombre:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 6))
strTemp = Replace(strTemp, "Nombre:", "")
Nombre = Trim(strTemp)
function transformar()
{
cadena=form.txtIntroducir.value
Trim (cadena)
longitud = Len(cadena)
temp1 = InStr(cadena, "Cuenta de mayor facturación:")
strTemp = Left(cadena, temp1 - 4)
temp2 = InStr(strTemp, "NIF/CIF:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 8))
strTemp = Replace(strTemp, "NIF/CIF:", "")
NIF_CIF = LTrim(strTemp)
cadena = Right(cadena, longitud - temp1)
longitud = Len(cadena)
temp1 = InStr(cadena, "Contacto:")
strTemp = Left(cadena, temp1 - 3)
temp2 = InStr(strTemp, "Nombre:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 6))
strTemp = Replace(strTemp, "Nombre:", "")
Nombre = Trim(strTemp)
}
</scrip>
Alguien podría decirme como puedo hacerlo. Un saludo y muchas gracias.
Tengo este codigo para que me corte trozos de un textarea pero me dice que se esperaba un objeto al darle al botón que llama a la función.
<script language="JavaScript" type="text/javascript">
function transformar()
{
cadena=form.txtIntroducir.value
Trim (cadena)
longitud = Len(cadena)
temp1 = InStr(cadena, "Cuenta de mayor facturación:")
strTemp = Left(cadena, temp1 - 4)
temp2 = InStr(strTemp, "NIF/CIF:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 8))
strTemp = Replace(strTemp, "NIF/CIF:", "")
NIF_CIF = LTrim(strTemp)
cadena = Right(cadena, longitud - temp1)
longitud = Len(cadena)
temp1 = InStr(cadena, "Contacto:")
strTemp = Left(cadena, temp1 - 3)
temp2 = InStr(strTemp, "Nombre:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 6))
strTemp = Replace(strTemp, "Nombre:", "")
Nombre = Trim(strTemp)
function transformar()
{
cadena=form.txtIntroducir.value
Trim (cadena)
longitud = Len(cadena)
temp1 = InStr(cadena, "Cuenta de mayor facturación:")
strTemp = Left(cadena, temp1 - 4)
temp2 = InStr(strTemp, "NIF/CIF:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 8))
strTemp = Replace(strTemp, "NIF/CIF:", "")
NIF_CIF = LTrim(strTemp)
cadena = Right(cadena, longitud - temp1)
longitud = Len(cadena)
temp1 = InStr(cadena, "Contacto:")
strTemp = Left(cadena, temp1 - 3)
temp2 = InStr(strTemp, "Nombre:")
Largetemp = Len(strTemp)
strTemp = Right(strTemp, Largetemp - (temp2 + 6))
strTemp = Replace(strTemp, "Nombre:", "")
Nombre = Trim(strTemp)
}
</scrip>
Alguien podría decirme como puedo hacerlo. Un saludo y muchas gracias.
