• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with the ajax app

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to build a small app in which there is a text box and when a user inputs any value in the text box , after the value is put in it the ajax code should check with the server whether there is any data in the database with that same value .If there is then a small message should appear at the side of the text box stating that the value is not available

the code is as follows




bean code


the page which needs to be displayed next to the text box



but here is the problem when ever i put the value in the text box i am getting the same message as available .....even if i put the value from the textbox
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in JavaScript you should never use "with". http://www.yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/

Do you see a problem here? xmlHttp.open("GET","serv.do",false);

I do.

Eric
 
Varun Nayudu
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:in JavaScript you should never use "with". http://www.yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/

Do you see a problem here? xmlHttp.open("GET","serv.do",false);

I do.

Eric



Eric could you please tell me what is the problem with the code which you have mentioned above ..
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are not sending up any form data to the server. The XMLHttpRequest object does not send up form fields like a normal form submission does.

Ajax 101

Eric
 
Varun Nayudu
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:You are not sending up any form data to the server. The XMLHttpRequest object does not send up form fields like a normal form submission does.

Ajax 101

Eric



So what should the code be . I though with ajax you could send the field to the server . What should i do then?
 
Varun Nayudu
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Varun Nayudu wrote:

Eric Pascarello wrote:You are not sending up any form data to the server. The XMLHttpRequest object does not send up form fields like a normal form submission does.

Ajax 101

Eric



So what should the code be . I though with ajax you could send the field to the server . What should i do then?




I was able to rectify it .Thanks eric for the info
xmlHttp.open("GET","serv.do?username="+username.value,false);

now its working fine
 
reply
    Bookmark Topic Watch Topic
  • New Topic