Skip to content

Instantly share code, notes, and snippets.

@kodi
Created February 26, 2009 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kodi/70869 to your computer and use it in GitHub Desktop.
Save kodi/70869 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript" charset="utf-8">
function mySubmit(){
var q=document.getElementById('q');
var s=document.getElementById('s');
// ne zaboravi ovo hvata elemente po ID ju
// ne po name-u .. oba elementa moraju daimaju id
q.value=s.value; // to je cela nauka
}
</script>
</head>
<body>
<form action="" method="post" accept-charset="utf-8">
<input type="text" name="s" value="" id="s">
<input type="hidden" name="q" value="" id="q">
<p><input type="submit" value="Continue &raquo;" onclick="mySubmit();"></p>
</form>
<?php
//dokaz
if(isset($_POST['q'])){
echo "<pre>";
print_r($_POST);
}
?>
<html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment