Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function(){
- $("#formulario").on("submit", function(e){
- e.preventDefault();
- var cdb = $("#cdb").val();
- $.ajax({
- url: "cdb.php",
- method: "POST",
- dataType: "html",
- data: cdb
- }).done(function(data){
- $("#cdb").val("");
- $("#cdb").focus();
- listar();
- }).fail(function(data){
- alert("Erro");
- });
- });
- });
- </script>
- <form id="formulario" method="POST" action="" accept-charset="utf-8">
- <div>
- <?php echo rand(1, 100) ?>
- <input id="cdb" type="text" name="cdb" class="validate" required autofocus onfocus="this.value='';">
- <button type="submit">GRAVAR</button>
- </div>
- </form>
- $cdb = filter_input(INPUT_POST,'cdb');
Add Comment
Please, Sign In to add comment