Hi Friends,
I am stuck for passing values from drop down list of a HTML page to a servlet file for further processing. Actually i am developing a small model of "Railway Reservation System" for my mini-project. The problem is to how can i pass values from various number of drop down lists to servlet file. Here is the code:

<html>....
<select name='source'>
<option value='1'>a</option>
<option value='2'>b</option>
<option value='3'>c</option>
</select>

<select name='destination'>
<option value='4'>d</option>
<option value='5'>e</option>
<option value='6'>f</option>
</select>

<select name='class'>
<option value='1c'>First Class</option>
<option value='ec'>Economy Class</option>
</select>

i have to select the source,destination and class of travel and pass it to servlet for further processing. I request you all people to please help me.

This code is nested inside a form tag and you have a submit button?

String class=req.getParameter("class");

Hi friends... this is subramanian, doing mca in park clg, cbe...
i think the following stmt is use full to u..

import java.lang.String[];
............
............
String[] vname=(String[])req.getParameter("class");
............
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.