ho w to check username availability in jsp
Hi friends,
I am doing a project in which there is a registration form where i have to check username availabitlity. When i click on the availability button the result should be displayed indicating whether it is available or not.
I have created it using ajax technique. But i want to know how it could be done using jsp and javascript.
The problem is how i could pass the username value to another jsp page without submitting the form
With Thanks,
Manu
[491 byte] By [
manu_ama] at [2007-11-27 10:14:02]

# 1
well why can't you use a iframe to display avalablity status...
now once the button is clicked the IFRAME is made visible and you would call controller by harcoding URL say something like...
<script>
function getAvailablity(){
this.document.getElementById('available').location.href = ' getAvailablity.do?username='+escape(this.document.xyz.username.value);
}
</script>
<form name="xyz">
<input name="username" type="text" value=""/>
<input name="username" value="availablity" type="button" onclick="getAvailablity()"/>
<iframe name="available" id="available" frameBorder="0" scrolling="no" style="width:200px;height:100px" />
</form>
Hope this this snippet might have given somekind of understading of what i'm trying to explain.
REGARDS,
RaHuL