refresh text box when a particular value is matched

OldSchool

New Member
I have a text box in index.jsp and after writing something i am calling a jsp by jquery. But my requirement is if a particular value will be matched in server side then how can i auto refresh that text box? It means suppose i entered apple then by onkeyup event i am sending the name(apple) to check.jsp and in this jsp page, I have kept apple in a string. So now an alert will come in index.jsp that apple already exists and simulatenously that text box will be auto refreshed. How can i do it? I am a beginner to this field.index.jsp\[code\]<script type="text/javascript"> $(document).ready(function() { $("#textbox").keyup(function () { $.getJSON('check.jsp', { textboxname: this.value }); }); }); </script>\[/code\]inside body\[code\]<input type="text" id="textbox" name="textboxname"/>\[/code\]check.jsp\[code\]String textboxname=request.getParameter("textboxname");\[/code\]
 
Top