Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to do client side validation in velocity template

 
Bala Bucks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using velocity template with spring MVC. can anyone help in doing client side validation in velocity template. i have attached the file here.
I tried out with java script.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<body>
<h1>Manage Configuration</h1>
<form id="pageForm" commandName="pageVO" method="POST">
<table>
<tr>
<td>
#springFormSingleSelect("pageVO.managePage" $manageConfig 'onchange="getParam();" id="pageList"')
</td>
</tr>
<tr>
<!-- <td><input type="hidden" id="pgType" value="pageVO.pageType" /></td> -->
<td>#springFormHiddenInput("pageVO.pageType" 'id="pgType"') </td>
</tr>
<tr>
<!-- <td><input type="hidden" id="pgTypeFlag" value="pageVO.pageTypeFlag" /></td> -->
<td>#springFormHiddenInput("pageVO.pageTypeFlag" 'id="pgTypeFlag"') </td>
</tr>
</form>
</body>
<script type="text/javascript">
function getParam(){
document.getElementById('pgType').value = document.getElementById('pageList').value;
document.getElementById('pgTypeFlag').value = "true";
document.forms["pageForm"].submit();
}
</script>
</html>
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a Velocity question. At the point it gets to the client side, it has nothing to do with Spring.

So which forum do you want me to move this thread?

Thanks

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic