I'm trying to POST to a JSP page some values with radio buttons.
It's a little paradoxic:
- By selecting another radio button it doesn't deselect the previous one, if I take various names for the radio buttons, but if I name the radio buttons equal it always returns me the value 'on' by trying to catch the value with -> request.getAttributes('filter').
To getting the value 'on' if one of them is selected is way pointless, if the speech is about radio buttons.
My question now is how will I able to catch which one of them is selected? Maybe by setting the value tag and getting it on the JSP site? If so, how is that achievable?
The worst case is, that I name the radio buttons with various values and deselect the previous one with javascript.
<form method="post" action="./activity.jsp">
<input type="radio" name="filter" value="nofilter" checked="checked"> Kein Filter
<input type="radio" name="filter" id="dayRadio"> Tag
<input type="text" id="day" onfocus="choosed(this)">
<input type="radio" name="filter" id="weekRadio"> Woche
<input type="text" id="week" onfocus="choosed(this)">
<input type="radio" name="filter" id="monthRadio"> Monat
<input type="text" id="month" onfocus="choosed(this)">
<input type="radio" name="filter" id="yearRadio"> Jahr
<input type="text" id="year" onfocus="choosed(this)">
<input type="submit" value="OK">
</form>