1

I want to retrieve value from radio button, here is my index.jsp

<form action="upload" method="post" enctype="multipart/form-data">
  <input type="radio" name="radios" value="radio1" checked>Radio Button 1
  <input type="radio" name="radios" value="radio2">Radio Button 2
  <table border="1">
    <tr>
      <td>
        <input type="file" name="file" />
      </td>
    </tr>
  </table>
  <input type="submit" value="Upload" />
</form>

I have used the radio button along with file input and so I need to keep the multipart/form-data.

I first tried with request.getParameter("radios") but later I came to know that it is impossible to retrieve value with it.

Harry
  • 87,580
  • 25
  • 202
  • 214
  • Assuming that you are on Servlet < 3.0, the third part of [this](http://stackoverflow.com/a/2424824/174184) answer should help you. – TJ- Jul 04 '15 at 11:54
  • Please put the HTML code within the box provided for HTML in the snippet editor. I have also fixed some capitalization issues and improved the grammar. Language/library/tool names are not required in title because they can be added as part of tags and so I have removed it from the title. – Harry Jul 04 '15 at 12:38

0 Answers0