Jump to content

Ayuda xD


Recommended Posts

Hola gente del foro, Gracias por leer esto.

 

Mi problema es el siguiente.

 

Quiero hacer un formulario de registro (http://applicationloading.comeze.com/registro.html) cabe aclarar es mi espacio de prueba en la web xD... Cuando los usuarios elijan una imagen se cargue donde dice TU IMAGEN (<img alt="tu imagen">) intente con Jscript pero sólo me lee el nombre de la imagen por ejemplo : fondo.jpg... (Necesito que sirva en mi pc primordial mente) pero solo me sirven las imágenes que están en la misma carpeta del archivo

 

Miren el Código

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
   <head>
      <title>Registro de Usurios</title>
   </head>
   <script language="javascript">
       function change()
        {
            var data = document.form1.foto.value;
            if(data == "")
            {
                
            }else {
            document.images["foto1"].src = data; }
        }
   </script>
   <body style="font-family: Arial, Times New Roman;">
      <div style="width:800px; margin:auto;">
      <h1 align="center">Registro de Usuarios</h1>
      <form id="registro" name="form1" action="validador.html" method="post">
               <fieldset>
                  <legend>Datos personales</legend>
                 
                  <table width="100%" align="center">
                    <tr>
                           <td><label for="name">Nombre: </label></td>
                           <td><input type="text" id="name" name="name"/></td>
                           <td rowspan="3" valign="top" ><label for="hobbies">Hobbies: </label><br><textarea name="hobbies" id="hobbies" cols="30" rows="3">Tus Hobbies separados por comas</textarea></td>
                     </tr>
                     <tr>
                           <td><label for="apellidos">Apellidos: </label></td>
                           <td><input type="text" id="apellidos" name="apellidos"/></td>
                     </tr>
                     <tr>
                           <td><label for="user">Usuario: </label></td>
                           <td><input type="text" id="user" name="user"/></td>
                     </tr>
                     <tr>
                           <td><label for="pass">Contraseña: </label></td>
                           <td><input type="password" id="pass" name="pass"/></td>
                           <td rowspan="3">
                            <label>Seleccione sus colores favoritos:  </label><br><input type="checkbox" name="color" value="azul">Azul</input>
                            <br><input type="checkbox" name="color" value="amarillo">Amarillo</input><br><input type="checkbox" name="color" value="rojo">Rojo</input></td>
                     </tr>
                     <tr>
                           <td><label for="repass">Repetir contraseña: </label></td>
                           <td><input type="password" id="repass" name="repass"/></td>
                     </tr>  
                      <tr>
                           <td><label for="email">Email: </label></td>
                           <td><input type="text" id="email" name="email"/></td>
                     </tr>
                     <tr>
                           <td><label for="pais">País: </label></td>
                           <td>
                                <select id="pais" name="pais">
                                    <option value="argentina">Argentina</option>
                                    <option value="brazil">Brazil</option>
                                    <option value="chile">Chile</option>
                                    <option value="colombia">Colombia</option>
                                    <option value="usa">United States</option>
                                    <option value="uk">United Kingdom</option>
                                </select>
                           </td>
                           <td rowspan="6">
                                   <div align="left"><label for="foto">Examinar: </label>
                                <input type="file" name="foto" id="foto"  onChange="change()">
                                </div>
                                <img src=""  name="foto1" width="120" height="120" alt="Tu imagen">
                                <br>
                              <input type="submit" value="Enviar"/><input type="reset" value="Limpiar"/>
                                
                           </td>
                     </tr>
                      <tr>
                           <td><label for="departamento">Departamento: </label></td>
                           <td>
                                <select id="departamento" name="departamento">
                                    <option value="antioquia">Antioquia</option>
                                </select>
                           </td>
                        </tr>
                        <tr>
                             <td><label for="ciudad">Ciudad: </label></td>
                             <td>
                                <select id="ciudad" name="ciudad">
                                    <option value="medellin">Medellín</option>
                                    <option value="bogota">Bogotá</option>
                                    <option value="manizales">Manizales</option>
                                    <option value="cali">Cali</option>
                                    <option value="cartagena">Cartagena</option>
                                </select>
                            </td>
                     </tr> 
                      <tr>
                           <td><label for="address">Dirección: </label></td>
                           <td><input type="text" id="address" name="address"/></td>
                     </tr>
                     <tr>
                           <td><label for="telefono">Teléfono: </label></td>
                           <td><input type="text" id="telefono" name="telefono"/></td>
                     </tr>
                     <tr>
                           <td><label for="sexo">Sexo: </label></td>
                           <td>
                                   <input type="radio" id="sexo" name="sexo" value="male">Masculino</input>
                                <input type="radio" id="sexo" name="sexo" value="female">Femenino</input>
                           </td>
                     </tr>
                     </table>
                    
               </fieldset>


      </form>
   </div>
   </body>
</html>
}

Edited by Alexsoto14
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...