Tema: Ayuda
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/02/2011, 02:54
Avatar de syntex
syntex
 
Fecha de Ingreso: noviembre-2002
Ubicación: Cataluña
Mensajes: 978
Antigüedad: 22 años, 5 meses
Puntos: 4
Ayuda

Hola buenas soy un poco novato en js,

Quisiera ampliar en javascript un text del formulario pero veo que no me lo hace bien.

Porque??? Como podria mejorarlo?

Código HTML:
<script type="application/javascript">
 function Grande(name)
 {
	var name;
	if (name == "user")
	{
		var text = document.forms[0].user.style.fontSize;
		document.forms[0].user.style.fontSize = "20px";
		document.forms[0].user.style.fontWeight = "bold";
	}else{
		document.forms[0].user.style.fontSize = "";
		document.forms[0].user.style.fontWeight = "";
	}
	
	if (name == "pass")
	{
		var text = document.forms[0].pass.style.fontSize;
		document.forms[0].pass.style.fontSize = "20px";
		document.forms[0].pass.style.fontWeight = "bold";
	}
	else{
		document.forms[0].pass.style.fontSize = "";
		document.forms[0].pass.style.fontWeight = "";
	}
 }
</script> 
Código HTML:
<table cellpadding="0" cellspacing="2" width="100%" class="fondo_data" style="height:160px;">
            
            	<tr><td height="30"></td></tr>
				<tr>
					<td align="right" width="40%">
					<font class="size11_negro"><strong>Usuario .:</strong></font>
					</td>
					<td align="left">
					<input type="text" name="user" value="<? echo $crypt->decode(stripslashes($_POST[user])); ?>" size="20" maxlength="50" class="form_panel_left_negro" onclick="Grande('user');"  />
					</td>
				</tr>
				<tr>
					<td align="right">
					<font class="size11_negro"><strong>Contraseña .:</strong></font>
					</td>
					<td align="left">
					<input type="password" name="pass" value="" size="15" maxlength="20" class="form_panel_left_negro" onclick="Grande('pass');" />
					</td>
				</tr>
				<tr>
				<td colspan="2"><hr size="1" style="color:#CCCCCC;" /></td>
				</tr>
				<tr>
					<td align="right" width="100">
					
					</td>
					<td align="left">
                    <button type="submit" name="cont" class="button"  value="Continuar >">
                    	<img src="http://www.forosdelweb.com/f13/web/img/icons/arrow_green.png" border="0" />&nbsp;&nbsp;
                    	<span class="size12_negro">Acceder</span>
                    </button>
					</td>
				</tr>
                <tr><td height="30"></td></tr>
                
			</table> 
Muchas gracias
__________________
------------------------------------------------
La paciencia es el rey de la ciencia
------------------------------------------------