Ver Mensaje Individual
  #6 (permalink)  
Antiguo 17/08/2007, 10:57
Randill
 
Fecha de Ingreso: agosto-2003
Mensajes: 52
Antigüedad: 20 años, 8 meses
Puntos: 0
Re: En un action, como evitar que pase el name="nombre_que_ sea" del input???

Weno lo primero es ke te faltaba un ; } al terminar el form.submit();
Cita:
Iniciado por RoskyAu Ver Mensaje
Código PHP:
<head>
<
script language="javascript">

    function 
pasaValor(form){
    
form.Dos.value form.Uno.value;
    
form.Tres.value form.Dos.value;
}

    function 
enviaform(form){
    
form.action "http://dominio/cgi/" form.Uno.value "URL" +         form.Dos.value  "URL" form.Tres.value "URL";
    
form.submit() ;}
</script>
</head>

<body>

<form name="dipu"> 
<input type=text name="Uno" value="" SIZE="10" onKeyUp="pasaValor(this.form)">
<input type="hidden" name="Dos">
<input type="hidden" name="Tres">
<input type="button" Onclick="javascript:enviaform(this.form)" value="Buscar">
<input type="button" OnClick="javascript:ResetForm();" value="Borrar">&nbsp;</form> 
Lo segundo es que sigue tirando el nombre de los campos en la url, asi ke lo ke podrias hacer es como usas GET, podrias usar el location y daria un resultado practicamente = (recomendado)
Lo otro es cambiar el method del formulario a POST, ahi se iria al action con las variables correctas, pero tambien enviaria al server vars pr el metodo POST.
Código PHP:
 function enviaform(form){
location.href "http://dominio/cgi/" form.Uno.value "URL" +         form.Dos.value  "URL" form.Tres.value "URL";

Si no podrias sacar los campos del formulario y generar el action por las ids de lso campos(tambien recomendado)
Código PHP:
<head>
<
script llanguage="javascript">
function 
enviaform(form){
form.action "http://dominio/cgi/" document.getElementById("Uno").value "URL" +         document.getElementById("Dos").value  "URL" document.getElementById("Tres").value "URL";
 
form.submit() ;}

function 
pasaValor(form){
document.getElementById("Dos").value document.getElementById("Uno").value;
document.getElementById("Tres").value document.getElementById("Dos").value;
}
</script>
</head>
<body>
<form id="dipu" method="">
</form>
<input type=text id="Uno" value="" SIZE="10" onKeyUp="pasaValor(document.getElementById("dipu"))">
<input type="hidden" id="Dos">
<input type="hidden" id="Tres">
<input type="button" Onclick="javascript:enviaform(document.getElementById("dipu"))" value="Buscar">
<input type="button" OnClick="javascript:document.getElementById("dipu").ResetForm();" value="Borrar">&nbsp;