Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 17249
    
    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
 
Similar Threads
Getting error
id of radio button not unique when SelectItemGroup is used
fakepath error in vista
Table with Scrollbar
does firefox have a problem with .setAttribute ?