• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how can i send a request to a servlet without submitting the whole form

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a form in a JSP, this form has 2 combo boxes. the second combo box will be empty until the user choose a value from the first combobox.

so I have the select tag as follows in the jsp

<select name="country" id="firstBox" onchange="retreiveSecondList()">
<option value="" SELECTED>
......
</select>

and defined a js function

function retreiveSecondList(){
firstBox = document.getElementById('firstBox');
//Nothing selected
if(firstBox.selectedIndex==0){
return;
}

selectedOption = firstBox.options[firstBox.selectedIndex].value;
url="/BS/RegisterServlet?selectedOption="+firstBox.selectedIndex;


}
how can I send a request through this method having the selected index from the first combobox?

i have tried
req = new HttpServletRequest();
req.open("GET", url, true);
req.send();

but it s not working!!!
anyone has any idea about that?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what is this function look like: HttpServletRequest();

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic