Foros del Web » Creando para Internet » HTML »

FORMULARIOS: No me recoge los datos, ayuda please

Estas en el tema de FORMULARIOS: No me recoge los datos, ayuda please en el foro de HTML en Foros del Web. Bueno pues resulta q tengo una pagina html kon un formulario q en el action hace referencia a la web asp y el method es ...
  #1 (permalink)  
Antiguo 23/03/2004, 10:21
 
Fecha de Ingreso: marzo-2004
Ubicación: Extremadura
Mensajes: 92
Antigüedad: 20 años
Puntos: 0
FORMULARIOS: No me recoge los datos, ayuda please

Bueno pues resulta q tengo una pagina html kon un formulario q en el action hace referencia a la web asp y el method es post. Resulta q si envio los datos con un boton input type="submit" me recoge todos los datos en la web asp mediante el metodo request("nombre del campo de texto") pero si en vez de un boton de ese tipo pongo una imagen y le digo ke me enlace kon la web asp pues no me rekoge los datos y me gustaria poder ponerla kon la imagen porque la verdad ke los input type son un poco cutres jeje

Gracias por adelantada
__________________
Aupa Athletik!!!
  #2 (permalink)  
Antiguo 23/03/2004, 10:52
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 23 años, 2 meses
Puntos: 535
mostrá el código del formularios y el que usás para recoger los datos... yo tengo forms que se envían con un una imagen en vez de un botón submit y funcionan perfectamente

saludos

PD: bienvenido al foro
__________________
...___...
  #3 (permalink)  
Antiguo 23/03/2004, 11:49
 
Fecha de Ingreso: enero-2004
Mensajes: 154
Antigüedad: 20 años, 2 meses
Puntos: 0
¿Como le dices que enlace con la web?

Seguro que es eso lo que te falla.
pon ...href='javascript:IrA()'...
y creas una función que redireccione la página con un submit:
function IrA(){
document.forms[0].action="pagina.asp";
document.forms[0].submit();
}

el forms[0] dependerá de en que formulario estés trabajando pero si solo usas un marco puedes hacerlo con el código que te he puesto tal cual.

Saludos!!!!!
  #4 (permalink)  
Antiguo 23/03/2004, 13:56
 
Fecha de Ingreso: marzo-2004
Ubicación: Extremadura
Mensajes: 92
Antigüedad: 20 años
Puntos: 0
para empezar gracias por el recibimiento :) y ahora pues vamos a ver el codigo.

1- Pagna HTML

<form name="form1" method="post" action="Registrado.asp">
<div align="left">
<p align="center"><font color="#C0C0C0" size="4">Para registrarte en la web
debes rellenar los siguientes campos</font></p>
<div align="center">
<table width="64%" border="0">
<tr>
<td width="8%" height="45"><font color="#C0C0C0">Nick:</font></td>
<td width="92%"><input name="Pass" type="text" id="Pass" size="25" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual>
&nbsp;</td>
</tr>
<tr>
<td height="52"><font color="#C0C0C0">Contrase&ntilde;a:</font></td>
<td><input name="Pass" type="password" id="Pass" size="25" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="41"><font color="#C0C0C0">Nombre:</font></td>
<td><input name="Nombre" type="text" id="Nombre2" size="25" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="41"><font color="#C0C0C0">Apellidos:</font></td>
<td><input name="Apellidos" type="text" id="Apellidos2" size="40" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="41"><font color="#C0C0C0">Edad:</font></td>
<td><select name="Edad" size="1" id="select" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual>
<option>menos de 16</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
<option>32</option>
<option>33</option>
<option>34</option>
<option>35</option>
<option>36</option>
<option>37</option>
<option>38</option>
<option>39</option>
<option>40</option>
<option>mas de 40</option>
</select></td>
</tr>
<tr>
<td height="42"><font color="#C0C0C0">E-mail:</font></td>
<td><input name="Email" type="text" id="Email2" size="40" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="45"><font color="#C0C0C0">Ubicaci&oacute;n:</font></td>
<td><input name="Ubicacion" type="text" id="Ubicacion2" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="48"><font color="#C0C0C0">Firma: (*)</font></td>
<td><input name="Frase" type="text" id="Frase" size="50" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
</table>
</div>
<p align="center"> (*) La firma que usted inserte servira para ponerla al
final de cada uno de los mensajes escritos</p>
<p align="center">&nbsp; </p>
<div align="center">
<table width="56%" border="0">
<tr>
<td width="47%"><div align="center"> <a href="registrado.asp" type="submit" target="derecha" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','images/aceptar2.gif',1)">
</a><a href="registrado.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/aceptar2.gif',1)"><img src="images/aceptar1.gif" name="Image3" width="80" height="31" border="0"></a><a href="registrado.asp" type="submit" target="derecha" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','images/aceptar2.gif',1)">
</a></div></td>
<td width="53%"><div align="center"> <a href="registro.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','images/borrar2.gif',1)"><img src="images/borrar1.gif" name="Image2" width="80" height="31" border="0"></a></div></td>
</tr>
</table>
</div>
<p>&nbsp; </p>
<p>&nbsp;</p>
</div>
</form>

ahi va el formulario entero, mucho codigo basura pero bueno, asi esta todo... y ahora vamos a pasar al codigo asp:


<body bgcolor="#000000" text="#CC0000">

<%
Set Conexion=Createobject("ADODB.Connection")
Conexion.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & server.mappath("/") & "\base.mdb;"
ordensql="Insert into Usuarios values ('" & request("Nick") & "','" & request("Pass") & "',null)"
set registros=conexion.execute(ordensql)

ordensql="Insert into Datos_Usuarios values ('" & request("Nick") & "','" & request("Nombre") & "','" & request("Apellidos") & "','" & request("Edad") & "','" & request("Email") & "','" & request("Ubicacion") & "','" & request("Frase") & "')"
set registros=Conexion.execute(ordensql)
%>
<p align="center">&nbsp;</p>
<p align="center"><font color="#408080" size="4"><u>Usuario Registrado correctamente</u></font></p>
<p align="center"><font color="#FFFFFF"> <u> </u></font></p>
<div align="center">
<table width="75%" border="0">
<tr>
<td width="41%"><font color="#408080">Su nombre de usuario es:</font></td>
<td width="59%"><font color="#CCCCCC"><u>
<% response.write(request("Nick")) %>
</u></font></td>
</tr>
<tr>
<td><font color="#408080">Su contrase&ntilde;a es:</font></td>
<td><font color="#CCCCCC"><u>
<% response.write(request("Pass")) %>
</u></font></td>
</tr>
</table>
<p>&nbsp;</p>
<p><font color="#C0C0C0">Gracias por registrarte, ya puedes acceder a la web.</font></p>
</div>
</body>


Pues esto es lo q hay y poniendo un boton submit funciona pero con la imagen no y no se por que... Saludos a todos!!!
__________________
Aupa Athletik!!!
  #5 (permalink)  
Antiguo 23/03/2004, 14:31
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 23 años, 2 meses
Puntos: 535
Ya veo... porque estás haciendo un enlace normal con la imágen a la página "Registrado.asp" en vez de hacer el submit del formulario.

O hacés como dice ivan_noe (crearte una función que establezca el action para el formulario y luego lo envíe) o ponés un "input type image" de esta manera:


<input name="Image3" type="image" src="images/aceptar1.gif" border="0" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/aceptar2.gif',1)">


Saludos
__________________
...___...
  #6 (permalink)  
Antiguo 23/03/2004, 14:46
 
Fecha de Ingreso: marzo-2004
Ubicación: Extremadura
Mensajes: 92
Antigüedad: 20 años
Puntos: 0
Esto empieza a ser grave... sigue sin funcionar... asi ha kedado el codigo y el asp no ha variado para nada...

<body bgcolor="#000000" text="#CCCCCC" onLoad="MM_preloadImages('images/aceptar2.gif','images/borrar2.gif')">
<form name="form1" method="post" action="Registrado.asp">
<div align="left">
<p align="center"><font color="#C0C0C0" size="4">Para registrarte en la web
debes rellenar los siguientes campos</font></p>
<div align="center">
<table width="64%" border="0">
<tr>
<td width="8%" height="45"><font color="#C0C0C0">Nick:</font></td>
<td width="92%"><input name="Pass" type="text" id="Pass" size="25" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual>
&nbsp;</td>
</tr>
<tr>
<td height="52"><font color="#C0C0C0">Contrase&ntilde;a:</font></td>
<td><input name="Pass" type="password" id="Pass" size="25" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="41"><font color="#C0C0C0">Nombre:</font></td>
<td><input name="Nombre" type="text" id="Nombre2" size="25" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="41"><font color="#C0C0C0">Apellidos:</font></td>
<td><input name="Apellidos" type="text" id="Apellidos2" size="40" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="41"><font color="#C0C0C0">Edad:</font></td>
<td><select name="Edad" size="1" id="select" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual>
<option>menos de 16</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
<option>32</option>
<option>33</option>
<option>34</option>
<option>35</option>
<option>36</option>
<option>37</option>
<option>38</option>
<option>39</option>
<option>40</option>
<option>mas de 40</option>
</select></td>
</tr>
<tr>
<td height="42"><font color="#C0C0C0">E-mail:</font></td>
<td><input name="Email" type="text" id="Email2" size="40" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="45"><font color="#C0C0C0">Ubicaci&oacute;n:</font></td>
<td><input name="Ubicacion" type="text" id="Ubicacion2" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
<tr>
<td height="48"><font color="#C0C0C0">Firma: (*)</font></td>
<td><input name="Frase" type="text" id="Frase" size="50" style="background-color: rgb(100,100,100); color: rgb(196,196,196); cursor: default; font-family: Arial; font-size: 12px" rows=3 wrap=virtual></td>
</tr>
</table>
</div>
<p align="center"> (*) La firma que usted inserte servira para ponerla al
final de cada uno de los mensajes escritos</p>
<p align="center">&nbsp; </p>
<div align="center">
<table width="56%" border="0">
<tr>
<td width="47%"><div align="center">
<input name="Image3" type="image" src="images/aceptar1.gif" border="0" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/aceptar2.gif',1)"></div></td>
<td width="53%"><div align="center"> <a href="registro.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','images/borrar2.gif',1)"><img src="images/borrar1.gif" name="Image2" width="80" height="31" border="0"></a></div></td>
</tr>
</table>
</div>
<p>&nbsp; </p>
<p>&nbsp;</p>
</div>
</form>
</body>

Bueno a ver si le encontrais el fallo porque me estoy volviendo loco... jeje
__________________
Aupa Athletik!!!
  #7 (permalink)  
Antiguo 23/03/2004, 14:51
 
Fecha de Ingreso: marzo-2004
Ubicación: Extremadura
Mensajes: 92
Antigüedad: 20 años
Puntos: 0
Ays perdonad que el fallo es mio y es que resulta que cuando copié la caja de texto se me olvido cambiarle el nombre y la de nick se llamaba pass, pero le he puesto nick y ya funciona... cosas que pasan por enrear mas de la cuenta jeje
muchas gracias
__________________
Aupa Athletik!!!
  #8 (permalink)  
Antiguo 23/03/2004, 14:55
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 23 años, 2 meses
Puntos: 535
ok, menos mal que se solucionó.
Paso tu mensaje al foro HTML ya que se ha resuelto por ese lado y, al parecer, el ASP estaba perfecto
  #9 (permalink)  
Antiguo 23/03/2004, 14:59
 
Fecha de Ingreso: marzo-2004
Ubicación: Extremadura
Mensajes: 92
Antigüedad: 20 años
Puntos: 0
de acuerdo dazuaga y de nuevo gracias por la ayuda :) espero q la proxima vez q escriba sea para resolver algo
__________________
Aupa Athletik!!!
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 20:49.