Originally posted by Ian Morris:
I have an HTML form (within a jsp) with an input text box, is there a way I can do the following:
1. User enters some text into a text input box
2. User presses a button next to the text box
3. The button invokes a javaScript fuction
4. The javaScript invokes a java servlet which does an ldap query using the text from the original HTML text box.
5. The ldap query returns some data to the javaScript function
6. The javaScript function updates the html page.
I do not know how to do steps 4 and 5, has anybody done something similar, or know how to do this?
Help greatly appreciated.
Ian.
Well, I've used java code in calling methods of beans within the javascript but not called a servlet.
You could also call the servlet right from the button. I am pretty sure that a servlet can only be called with a get/post from a form/action. Apologies for vagueness.