• 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

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
 
What's wrong? Where are you going? Stop! Read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic