Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script> function cambia() { document.getElementById('cajatxt').value = n; document.location.href="xxx.php?cajatxt = " + n ; } </script> <title>Documento sin título</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form1" method="post" action=""> <input type="submit" name="Submit" value="envia valor" onClick="cambia()"> <input name="cajatxt" type="text" id="cajatxt"> </form> </body> </html>