View Single Post
Old 07-14-2004, 06:12 PM   #1 (permalink)
sammy
Code Monkey
 
sammy's Avatar
 
Join Date: Jun 2004
Location: Brooklyn/Rochester
Posts: 53
sammy is on a distinguished road
Send a message via AIM to sammy
Using javascript to submit a form

Ok, so I want to submit a form with javascript. But the thing is, i want to use the post method. So that the information is hidden to the user.

Code:
<?
print($_POST['sammy']);

?>
<form name="myform" action="test1.php" method="POST">

<input type="hidden" name="sammy" value="sammy">
<a href="#" onclick="javascript:myform.submit()">CLICK HERE</a>
</form>
<script type="text/javascript" language="javascript">
<!--
function sub(){
         document.myform.submit();
}

//-->
</script>
when i click the link, it shows this url on the browser :
/test1.php?sammy=sammy
__________________

Last edited by sammy; 08-11-2004 at 08:54 AM.
sammy is offline   Reply With Quote