This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Spring and the fly likes how to do client side validation in velocity template Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "how to do client side validation in velocity template" Watch "how to do client side validation in velocity template" New topic
Author

how to do client side validation in velocity template

Bala Bucks
Greenhorn

Joined: Jul 24, 2009
Posts: 3
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

Joined: Feb 05, 2001
Posts: 17260
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to do client side validation in velocity template