Foros del Web » Programando para Internet » Javascript »

dificultad con onchange

Estas en el tema de dificultad con onchange en el foro de Javascript en Foros del Web. compañeros del foro, espero esten muy bien y que me puedan colaborar con lo siguiente: tengo el codigo que se muestra a continuacion, el cual ...
  #1 (permalink)  
Antiguo 28/02/2005, 09:12
Avatar de vpino  
Fecha de Ingreso: diciembre-2004
Ubicación: colombia
Mensajes: 265
Antigüedad: 19 años, 4 meses
Puntos: 0
dificultad con onchange

compañeros del foro, espero esten muy bien y que me puedan colaborar con lo siguiente:
tengo el codigo que se muestra a continuacion, el cual con el evento onchange de un combobox llama una nueva entana donde se muestra determinada informacion.
(ventana de editarpedido.asp) lo que realmente necesito es que la ventana(editarpedido.asp) se abra en la ventana actual y no en una nueva.

mil gracias por la colaboracion.


<select name="IDCliente" onChange="pedidos();">
<option value="0">[Seleccione un Cliente]</option>
<% Do While Not rs.EOF
strValor1 = rs(0)
%>
<option value="<%= rs(0) %>" <%= fselectMe(strValor1, lngIDCliente) %>><%= rs(1) %></option>
<% rs.MoveNext
Loop %>
</select>


<script language="JavaScript">
function pedidos() {
rs("Clientes","editarpedido.asp?idcliente="+docume nt.clientes.IDCliente.value,target="entrar")
}
</script>
  #2 (permalink)  
Antiguo 28/02/2005, 09:32
 
Fecha de Ingreso: enero-2005
Mensajes: 114
Antigüedad: 19 años, 3 meses
Puntos: 0
target="_self"
  #3 (permalink)  
Antiguo 28/02/2005, 12:52
Avatar de Muzztein  
Fecha de Ingreso: agosto-2002
Ubicación: Hangar 18
Mensajes: 1.703
Antigüedad: 21 años, 8 meses
Puntos: 16
jujuju..en el otro foro me mande el tremendo carril ....

=)


checa esto

Cita:
window.open( )
Creates a new secondary browser window and loads the referenced resource.

Syntax
WindowObjectReference = window.open(strUrl, strWindowName [, strWindowFeatures]);

Return value and parameters
WindowObjectReference
This is the reference pointing to the newly created browser window. This reference is the return value of the open() method; such reference will exist only if the window.open() instruction succeeded. A global variable is best used to store such reference. This window reference can be useful and is needed to access properties and methods of the new browser window.
strUrl
This is the string of the referenced resource that will be loaded in the new window. strUrl can be an HTML document on the web, it can be an image file or any type of file which is supported by the browser.
strWindowName
This is the string that just names the new window. Such string can be used to be the target of links and forms when the target attribute of an <a> element or of a <form> is specified. This string parameter should not contain any blank space. strWindowName does not specify the title of the new window.
strWindowFeatures
Optional parameter. This parameter is the string which lists the requested window features (window functionalities and toolbars) of the new browser window. This string parameter must not contain any blank space. Each requested window feature must be separated by a comma inside the character string.

http://www.mozilla.org/docs/dom/domr...dow_ref76.html

Última edición por Muzztein; 28/02/2005 a las 12:53
  #4 (permalink)  
Antiguo 28/02/2005, 12:59
Avatar de vpino  
Fecha de Ingreso: diciembre-2004
Ubicación: colombia
Mensajes: 265
Antigüedad: 19 años, 4 meses
Puntos: 0
por favor me disculpan pero no entiendo el codigo aqui citado. y les agradezco por esforzarsen en ayudarmen.
  #5 (permalink)  
Antiguo 28/02/2005, 13:24
Avatar de RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 2 meses
Puntos: 50
Cita:
por favor me disculpan pero no entiendo el codigo aqui citado.
Y no sería mas fácil hacer un redirect desde tu javascript para despues por code asp recoger el ID

Ejemplo:

Cita:
function pedidos() {
window.location.href='editarpedido.asp?idcliente=' + document.clientes.IDCliente.value;
}
Salu2
__________________
Nadie roba nada ya que en la vida todo se paga . . .

Exentrit - Soluciones SharePoint & Net
  #6 (permalink)  
Antiguo 28/02/2005, 14:20
Avatar de vpino  
Fecha de Ingreso: diciembre-2004
Ubicación: colombia
Mensajes: 265
Antigüedad: 19 años, 4 meses
Puntos: 0
mil gracias compañero: antes de ver tu mensaje encontre en el foro algo muy parecido a lo que me sugieres, de tal manera que lo resolvi asi:

<select name="IDCliente" onChange="location.href('editarpedido.asp?idclient e=' + clientes.IDCliente.options[clientes.IDCliente.selectedIndex].value )">

muchisisisismas gracias por ayudarme, y seguire utilizando el servicio del foro hasta donde me lo permitan.
  #7 (permalink)  
Antiguo 28/02/2005, 16:05
Avatar de RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 2 meses
Puntos: 50
NP.....
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:05.