i dont think having 3 buttons is the best solution,basis on the logic and parameters method asked,
i believe this can be an accurate solution-
On the basis of parameters passed ,we can have 2 methods to access different actions via javascript-
1)getting values from user,checking them in javascript.
2)getting values from user,checking them in javascript,assigning values to hidden variables accordingly,calling servlets and using those hidden values.i have elaborated method1.
<html>
<head>
<script type="text/javascript">
function nawab() {
param = document.getElementById('param1').value;
alert('in nawab');
if (param != "") {
if (param === 'abc') {
alert('abc');
document.forms[0].action = "nawabServlet";
document.forms[0].submit();
}
if (param === 'def') {
alert('def');
document.forms[0].action = "nawabServlet2";
document.forms[0].submit();
}
}
else{
alert('empty');
document.forms[0].action = "nawabServlet";
document.forms[0].submit();
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>nawab has come</title>
</head>
<body>
<form>
param1:<input type="text" name="param1" id="param1"></select>
<input type="submit" onclick="nawab()">
</form>
</body>
</html>