3
How can I send information from mine <input />
automatically? Wanted this automatic process to be controlled by the field size of the input. For example, when the value reached 8 characters, it automatically send and move to another page. In this case mine action="sucesso.php"
. I know this is possible using javascript but I don’t know much about the language.
My code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<?php include 'func.php' ?>
<link href="index.css" rel="stylesheet"></link>
<link href="../Login/css/hover.css"></link>
</head>
<body>
<div class="container">
<form method="Post" action="sucesso.php" name="form">
<div class="txtbox-container hvr-glow">
<input type="text" name="txtbox" placeholder="Número do Cartão" autofocus>
</div>
</form>
</div>
<p><label id="result"></label></p>
<script type="text/javascript">
document.form.submit()
</script>
</body>
</html>
I already have the script in the code that sends automatically but does not have this field size control done.
Very good, I think the function
onkeyup
is the most suitable for the case! + 1– Igor Mello