Está en la página 1de 3

//Volver el valor de la columna con Auto_increment a 0 u otro

ALTER TABLE tabla AUTO_INCREMENT = valor


//Valor Boolean = BIT
$susc = 0;
if (isset($_POST['vb']))
$susc = 1;
//Redireccionar página (5 segundos)
echo '<script languaje="Javascript">
var pagina="VetWeb.html"
function redireccionar()
{
location.href="VetWeb.html"
}
setTimeout ("redireccionar()", 5000);
</script>';

//JAVASCRIPT - Habilitar y deshabilitar boton cuando se rellena el formulario


Te dejo 2 maneras de desactivarlo (la segunda en realidad lo oculta hasta que se
llenan los campos, la primera lo deshabilita hasta que se llenan los campos):
una)
<script>
function deshabilita(form)
{
if ((form.nombre.value != "") && (form.apellido.value != ""))
{ form.enviar.disabled = false; }
else {
form.enviar.disabled = true; }
}
</script>

<form name="f1" method="POST" action="pagina.htm" target="_blank">


Nombre: <input type="text" name="nombre" size="20" onkeyup="deshabilita(this.for
m)"><br>
Apellido: <input type="text" name="apellido" size="20" onkeyup="deshabilita(this
.form)"><br>
<input type="submit" name="enviar" value="Enviar" disabled>
</form>
dos)
<script>
function esconde(form)
{
if ((form.nombre.value != "") && (form.apellido.value != ""))
{ form.enviar.style.visibility = "visible"; }
else {
form.enviar.style.visibility = "hidden"; }
}
</script>

<form name="f1" method="POST" action="pagina.htm" target="_blank">


Nombre: <input type="text" name="nombre" size="20" onkeyup="esconde(this.form)">
<br>
Apellido: <input type="text" name="apellido" size="20" onkeyup="esconde(this.for
m)"><br>
<input type="submit" name="enviar" value="Enviar" style="visibility: hidden">
</form>

// JAVASCRIPT - Resaltar la caja de text a la hora de escribir o seleccionar


<form name="form1" method="post" action="">
Nombre <input type="text" name="nombre" onFocus="foco(this);" onBlur="no_foco(th
is);"
style="border:1px solid #CCCCCC">
<br>
Apellido <input type="text" name="apellido" onFocus="foco(this);" onBlur="no_foc
o(this);"
style="border:1px solid #CCCCCC"><br><br>
<input type="submit" name="Submit" value="Enviar">
</form>

<script>
function foco(elemento) {
elemento.style.border = "1px solid #000000";
}
function no_foco(elemento) {
elemento.style.border = "1px solid #CCCCCC";
}
</script>

VERIFICAR CONTRASEÑA DE DOS CAMPOS


<-- Codigo ofrecido por Tutores.org -->
<head>
<SCRIPT LANGUAGE="JavaScript">
function validar_clave() {
var caract_invalido = " ";
var caract_longitud = 6;
var cla1 = document.mi_formulario.mi_clave.value;
var cla2 = document.mi_formulario.mi_clave2.value;
if (cla1 == '' || cla2 == '') {
alert('Debes introducir tu clave en los dos campos.');
return false;
}
if (document.mi_formulario.mi_clave.value.length < caract_longitud) {
alert('Tu clave debe constar de ' + caract_longitud + ' caracteres.');
return false;
}
if (document.mi_formulario.mi_clave.value.indexOf(caract_invalido) > -1) {
alert("Las claves no pueden contener espacios");
return false;
}
else {
if (cla1 != cla2) {
alert ("Las claves introducidas no son iguales");
return false;
}
else {
alert('Contraeña correcta');
return true;
}
}
}
</script>
</HEAD>
<BODY>
<center>
<form name=mi_formulario onSubmit="return validar_clave()">
<p> Clave:
<input type=mi_clave name=mi_clave maxlength=12 size="20">
<br>
Repite Clave:
<input type=mi_clave name=mi_clave2 maxlength=12 size="20">
<p>
<input type=submit value="Comprobar">
</form>
</center>
</body>

---CAMBIAR EL COLOR DE LOS BOTONES CON CSS---


#stylized button{
clear:both;
margin-left:150px;
width:125px;
height:31px;
background:#FFFFFF url(img/button.png) no-repeat;
text-align:center;
line-height:31px;
color:#000000;
font-size:11px;
font-weight:bold;
}
#stylized button:hover {
background-color:#FFCC00;
color:black;
}
#stylized button:active {
background-color: #000000;
color: white;
}

También podría gustarte