struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sajidbigler <>
Subject Ajax for username availability
Date Tue, 03 Mar 2009 09:28:02 GMT

Do you have an example of ajax as taking textfield like username  and
invoking action to check whether the username is available or not and if
available ask user to enter another username or make the same filed empty

i tried to accomplish this by folowing

<script type="text/javascript">
   dojo.event.topic.subscribe("/after", function(data, request, widget){
   var username=dojo.widget.byId('username');
   username.innerHTML = "";
      alert('inside a topic event. after request');
      //data : text returned from request
      //request: XMLHttpRequest object
      //widget: widget that published the topic

<s:url var="ajaxTest" value="/AjaxTest.action" />

			<td>*<s:text name="label.username"></s:text></td>
			<td><sx:bind id="ex4" href="%{#ajaxTest}" sources="username"
				targets="username" events="onblur" afterNotifyTopics="/after" />
				label="User Name" name="username" required="true"
				requiredposition="left" /></td>

how can we can write action class which implements to take data from UI of
perticular field and check and return respose ?
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message