You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sajidbigler <sa...@gmail.com> on 2009/03/03 10:28:02 UTC
Ajax for username availability
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
});
</script>
<s:url var="ajaxTest" value="/AjaxTest.action" />
<tr>
<td>*<s:text name="label.username"></s:text></td>
<td><sx:bind id="ex4" href="%{#ajaxTest}" sources="username"
targets="username" events="onblur" afterNotifyTopics="/after" />
<s:textfield
label="User Name" name="username" required="true"
requiredposition="left" /></td>
</tr>
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: http://www.nabble.com/Ajax-for-username-availability-tp22305157p22305157.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org