<html>
<body>
<form id="myForm">
Firstname: <input id="fname" type="text" value="Mickey" />
Lastname: <input id="lname" type="text" value="Mouse" />
<input id="sub" type="button" value="Submit" />
</form>
<p>Get the value of all the elements in the form:<br />
<script type="text/javascript">
var x=document.getElementById("myForm");
for (var i=0;i<x.length;i++)
{
document.write(x.elements[i].value);
document.write("<br />");
}
</script>
</p>
</body>
</html>
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1297"></script>
function nif_valido(campo)
{
abc=campo.value
nif=abc.substring(0,abc.length-1)
let=abc.charAt(abc.length-1)
if (!isNaN(let))
{
alert('El nif debe tener 8 digitos y una letra al final ')
campo.focus()
return false
}
else
{
cadena="TRWAGMYFPDXBNJZSQVHLCKET"
posicion = nif % 23
letra = cadena.substring(posicion,posicion+1)
if (letra!=let.toUpperCase())
{
alert("NIF incorrecto.Revise la letra y no deje espacios. ")
campo.focus()
return false
}
}
return(true)
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/681"></script>