• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

how to do client side validation in velocity template

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic