as you know we can get post field by server side language like php,for example in php
$var1 = $_POST['field1']
now I wanna know is it possible to get it by JavaScript to?(or any Client Side Language like VBScript)
for example I have page which has got form
<form method = "post" action="test.php">
in test.php I wanna get field by JavaScript,not by php.
Is it possible and how can I do it if it’s possible?
You cannot read
$_POSTdata using JavaScript.When you submit data through the
GETmethod, the generated query string can be read through thelocation.searchobject. Another method to “post” data from page 1 to page 2 is by using hashes.The
locationobject (JavaScript)Example (based on the URL at the previous paragraph)
An alternative method to transmit data from a form to a JavaScript HTML page is by using hashes:
After submission, the following page will be requested:
index.html?someName=someValue#someHashThe
hashis available through thelocation.hashproperty.