You need to make an AJAX request. Although this is not strictly necessary, I suggest you use jQuery , this will simplify the situation. Please also take a look at this question: jQuery AJAX submit form
, , , , , . A.mc :
<html>
<head>
<title>This is A</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#myform").submit(function() {
$.ajax({
type: "POST",
url: "B",
data: $("#myform").serialize(),
success: function(data)
{
$("#result").html(data);
}
});
e.preventDefault();
});
});
</script>
</head>
<body>
<form id="myform">
<input type="text" name="mytext" />
<input type="submit" />
</form>
<div id="result"></div>
</body>
</html>
HTML-, jQuery , AJAX B, "", , B div.
B.mc:
<%class>
has 'mytext';
</%class>
I got this text <strong><% $.mytext %></strong> from your form,
and its length is <strong><% length($.mytext) %></strong>.
:
