Javascript Submit Value on Same Page or Different Page

HTML form's action attribute is responsible for your form's action script. You can mention script name directly in <form method="" action="" > or you can assign it a value through JavaScript.
Refer this Javascript code

There in function sub1() which is javascript form submit code, either comment the lines where I am mentioning the script name and setting action attribute using JS and set the action attribute in html to same page or change the page name (submitTo.php) to the same page. Now you can get the value of submitted input using $_POST, $_GET or $_REQUEST on same page.

Here is a sub1() function, I was talking about for JavaScript Submit.


<script>
function sub1(f1) {
// action attribute script
var submitTo = 'submitTo.php'; //'submitTo.php?var1=value1';
submitTo = encodeURI (submitTo);
// may be you like to validate fields before submitting.
if (v1.options[v1.selectedIndex].value == '#') {
alert("Please, Select type of your blog.");
return false;
}
// set action attributes to desired page
f1.action = submitTo;
// submit form
f1.submit();  // JavaScript form submit
return true;
}
</script>

For more detail on JavaScript Form Submitting, refer to the said page.