Article View: chile.comp.programacion
Article #1815Re: OnChange VBScript v/s JavaScript
From: gato2005_cl
Date: Tue, 23 May 2006 04:17
Date: Tue, 23 May 2006 04:17
78 lines
3262 bytes
3262 bytes
Para comenzar las comillas estan mal, se escriben asi " 'lo que sea' ",
a que lugar retorna la cadena de la funcion?, el resultado es
"Onchange='<p><input type='text' name='textfield'></p>'", lo cual no
tiene el menor sentido.
Si usaste response.write, usa document.write.
Lakrom escribi�:
> Se�ores tengo el siguiente codigo VBScript:
>
> <%
> sub Carga()
> if request("cod") = "ADJ" Then
> response.Write("<p><input type='text' name='textfield'></p>")
> else
> response.Write("<p> </p>")
> end if
> End Sub
> %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>Untitled Document</title>
> </head>
> <body>
> <p><form name="Form10" action="prb2.asp">
> <select name="select" onChange="location.href('prb2.asp?cod='+
> Form10.select.options[Form10.select.selectedIndex].value)">
> <option value="000" selected> </option>
> <option value="ADJ">Adjudicada</option>
> <option value="PER">Perdida</option>
> </select>
> </form>
> </p>
> <%Carga()%>
> </body>
> </html>
>
> Funciona OK pero ahora o implemente solo con javascript y se me desaparece
> el select.
> Algun experto de JavaScript que sepa como se hace.
>
> este es el codigo en java que no funciona.
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>Documento sin título</title>
> </head>
>
> <body>
> <form name="form">
> <select name="combo1" onChange="Mostrar()">
> <option value="000" selected> </option>
> <option value="ADJ">Adjudicada</option>
> <option value="PER">Perdidas</option>
> <option value="REC">Rechazada</option>
> </select>
> </form>
> <script language="javascript">
> function Mostrar()
> {
> if (document.form.combo1.value=='ADJ')
> {
> return('<p><input type='text' name='textfield'></p>');
> }
> else
> {
> return('<p> </p>');
> }
> }
> </script>
> </body>
> </html>
>
>
Technical Details
Message-ID:
<e4u2d6$so5$1@news.nivel5.cl>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!nntp-server.pubsub.com!news.nivel5.cl!not-for-mailReferences:
<e4tl57$2ik$1@proxy.ifxnw.cl>Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,6e835526db0d50a7 X-Google-Attributes: gid1593cb,public X-Google-Language: SPANISH,CP1252 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!nntp-server.pubsub.com!news.nivel5.cl!not-for-mail From: gato2005_cl <misforos.chileSINESTO@gmail.com> Newsgroups: chile.comp.programacion Subject: Re: OnChange VBScript v/s JavaScript Date: Tue, 23 May 2006 00:17:24 -0400 Organization: Varios Lines: 78 Message-ID: <e4u2d6$so5$1@news.nivel5.cl> References: <e4tl57$2ik$1@proxy.ifxnw.cl> NNTP-Posting-Host: pc-178-51-86-200.cm.vtr.net Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.nivel5.cl 1148357862 29445 200.86.51.178 (23 May 2006 04:17:42 GMT) X-Complaints-To: news@news.nivel5.cl NNTP-Posting-Date: Tue, 23 May 2006 04:17:42 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Win98; es-ES; rv:1.7.10) Gecko/20060419 Thunderbird/1.5.0.2 Mnenhy/0.7.4.0 In-Reply-To: <e4tl57$2ik$1@proxy.ifxnw.cl>