Jump to content

Submit automatico está quase resolvido. Falta só mais 2 detalhes Vejam:


Recommended Posts

Posted

Boa noite a todos. Pessoal o script abaixo está funcionando bem. Só falta dois 2 detalhes.

1º det: uma vez enviado o formulario o mesmo não retorna para a pagina anterior que é contato.php

2º det: Quero que o script pare de executar quando o formulario for enviado 10 vezes

Vejam o script abaixo. Obrigado!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Documento sem título</title>

<script language=javascript>

var qtd = 0;

var limit = 2;

var seconds = 10;

function submeter(){

if( qtd < limit ){

document.tetete.submit();

}

qtd++;

}

function start_sending(){

seconds *= 1000;

window.setInterval(function(){submeter()},seconds);

}

</script>

</head>

<body onload="start_sending();">

<form action="formularioscript.php" method="post" name="tetete">

</form>

</body>

</html>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.