Hi,
I am creating a form in jsp.
<form action="" method="post">
<input type="hidden" name="status_1" value="0" />
<input type="checkbox" id="status_1" name="status_1" value="1" />
<input type="hidden" name="status_2" value="0" />
<input type="checkbox" id="status_2" name="status_2" value="1" />
<input type="hidden" name="status_3" value="0" />
<input type="checkbox" id="status_3" name="status_3" value="1" />
<input type="submit" /> </form>
I was referring this link: http://stackoverflow.com/questions/19239536/how-get-value-for-unchecked-checkbox-in-checkbox-elements-when-form-posted
So, can you tell how this is priortized? I mean if I am marking chekcbox as checked, then how does it decide which value to take in the req parameter?
Also, is there any order dependent thing in this? if hidden input is written after the checkbox or before this?
Note: Although this answer is accepted, but it doesn't work for me if I place hidden input before checkbox. When I say not working means it was always taking hidden input value when I place hidden input before checkbox with same name.
Thanks in advance.