Ver Mensaje Individual
  #6 (permalink)  
Antiguo 01/07/2013, 07:53
franjgg
 
Fecha de Ingreso: marzo-2007
Mensajes: 751
Antigüedad: 17 años, 2 meses
Puntos: 4
Respuesta: Activar campos requeridos al pulsar link

Hola amigo tal,

Pues he hecho de este modo
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Documento sin título</title>
  5. <script type="text/javascript">
  6. function CamposRequeridos (){
  7.     document.getElementById('link').onclick = function () {
  8.         return false;
  9.     }
  10.         }
  11.         function Requeridos (){
  12.         document.getElementById('input').setAttribute('required', 'required');
  13.         }
  14.  
  15. </head>
  16.  
  17. <input type="text" name="s" />
  18.  <a onclick="CamposRequeridos();" id="link" name="link" href="*">Campos Requeridos</a>
  19. </body>
  20.  
  21. </form>
  22. </html>

La cosa es que no funciona en que me equivocado?

Muchas gracias!!