Вот код для получения POST:
{{velocity}}
#if ($request.getMethod() == "POST")
$request.getParameter("servicename")
#end
{{/velocity}}
Вот код для отправки POST:
{{velocity}}
{{html}}
Вот код для JavaScript:
<script type="text/javascript">
function validateForm()
{
c = confirm("Are you sure ?");
if(c == true){
alert("The foo has been created");
}else{
alert("The foo creation has been canceled.");
return false;
}
}
</script>
Вот код для HTML-формы:
<form name="myForm" action="$doc.getURL('view')" method="post" onsubmit="return validateForm()">
<input type="hidden" name="xaction" value="createservice" />
Foo Name:
<input type="text" name="servicename" />
<input type="submit" value="Create" />
</form>
{{/html}}
{{/velocity}}