can anyone please point me out what i'm missing here? I haven't configured the web.xml. I think we can do without configuring that xml. According to the tutorial video i followed, he didn't talked a single word about web.xml. So i think we can call servlet without the help of web.xml. But i'm not sure. When i press submit, i don't get anything. at least the alerts that i have put. Please help me.
Thanks you very much for your reply. Now i resolved that JS errors and now i can see my alert messages. I didn't configure the web.xml and i didn't put the action attribute in form tag. I thought that my query part is handling that task, isn't it? When i click the submit, my request is not hitting to servlet. I'm sorry asking this kind of a simple question. But still i can't fix this thing.
Have you fixed your code as suggested? Even if you do not want (for some unknown reason) to use the Forms plugin, responding to click events is outright wrong. What if the form is submitted in some other way? (Yes it can be.)
I strongly recommend the plugin. But if you resist that, at least respond to the correct event.
And, as I've already pointed out, your URL needs the context path.
Thank you sir... You saved my day....
I have put the action and method inside the form tag an done the mapping in web.xml.
But i have another simple problem. When i clicked the submit, my request goes to servlet and response is also coming. But the values in the JSON object is displaying in a white page. I wanted to capture those in my AJAX call and show them within my JSP. Could you please refer to my AJAX part and tell me my mistake there?
You saved my life. Now I am using the jquery form plugin for ajax calls. That is really awesome. Thank you again. Could you please show me an example where i want to send a textfield value before clicking to submit button?
This is basically, i want to check whether the entered email address is already registered one or not. I have done it using traditional ajax way. But i wonder whether i can use this ajax form plugin. I looked into their API. results were negative. Appreciate your help.
Jude Niroshan wrote:Could you please show me an example where i want to send a textfield value before clicking to submit button?
You could use the jQuery ".blur()" function. Bind that to the email input field and when the user tabs out of the email field or clicks away from it, you can fire off an Ajax query to see if the email already exists. If it does, you could move the focus back to the email field and ask for a different address or whatever response is correct for your application.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson