palAlaa
palAlaa

Reputation: 9838

redisplay user input

how can I redisplay user input, sinc the values of <input type="checkBox" name="group" value=${grp.groupNo}> is defined at run time? how can I use ${param} here to make comparison with unknown values?

Upvotes: 0

Views: 105

Answers (1)

BalusC
BalusC

Reputation: 1108537

In case of checkboxes (and radiobuttons) you'd like to set the checked attribute.

<input type="checkbox" name="group" value="${grp.groupNo}" ${grp.groupNo == param.group ? 'checked' : ''}>

The conditional operator ?: in EL will print checked when the condition is true. So it will then end up like follows in generated HTML:

<input type="checkbox" name="group" value="1" checked>

Upvotes: 2

Related Questions