Thursday, May 19th, 2005

XHR Server Validation with DWR

Category: Java

Joe Walker, creator of DWR, has put up info on Ajax Validation with DWR.

You can look at demo page, and a view source shows you how easy it is to add the JS:


Credit Card #: 
  <input id="cardnum" type="text" onchange="checkCardNum()"/>
  <span id="cardnum-error" class="error"></span>


<script type='text/javascript' src='/dwr/dwr/interface/CreditCardValidator.js'></script>
<script type='text/javascript' src='/dwr/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/dwr/util.js'></script>

function checkCardNum() {
  CreditCardValidator.isValid(replyCardNum, DWRUtil.getValue("cardnum"));

Servlet: web.xml


Posted by Dion Almaer at 5:32 pm
1 Comment

3.1 rating from 7 votes

1 Comment »

Comments feed

DWRUtil is what here ? any standard l i b r a r y?

Comment by mahendrakar — March 8, 2006

Leave a comment

You must be logged in to post a comment.