0

I created a dynamic table after receiving with hashmap. Previously I used json as input and javascript and I was able to pre-select radio buttons based on json input. However below code is not working neither for pre-selecting and when selecting the radio button only of all the radio buttons is being selected.

Please help, I am new to jsp and hashmap so pardon any syntax errors.

        <tr align="left">
        <td align="left"> <%out.println( tempsysDetails1.getCategory().get(i)); %> </td>
        <td align="left"> <input type="radio" name="inlineRadioOptions_' + i + '[]" value="0" id="inlineRadio0"' + 
        (tempsysDetails1.getSystemStatus().get(i)) = 0 ? ' checked="checked"' : '' ) + '><font color="black">Grey &emsp;</font><label class="radio-inline">
        <input type="radio" name="inlineRadioOptions_' + i + '[]" value="1" id="inlineRadio1"' + tempsysDetails1.getSystemStatus().get(i)) = 1 ? ' checked="checked"' : '') + 
        '><font color="green">Green &emsp;</font><label class="radio-inline"><input type="radio" name="inlineRadioOptions_' + i + '[]" +  id="inlineRadio2" value="2"' +  
        (tempsysDetails1.getSystemStatus().get(i)) = 2 ? ' checked="checked"' : ''  ) +  '><font color="yellow">Yellow &emsp;</font></label><label class="radio-inline">
        <input type="radio" name="inlineRadioOptions_' + i + '[]" id="inlineRadio3" value="3"' + 
        (tempsysDetails1.getSystemStatus().get(i)) = 3 ? ' checked="checked"' : '') + '> <font color="red">Red</font></label></td>  
        <td align="left"><input type="text" id= "comments[i]" class="form-control name_list" placeholder="<%out.println( tempsysDetails1.getComments().get(i)); %> ">  </td>

    </tr>

Attaching screenshot for reference:

enter image description here

tx-911
  • 427
  • 1
  • 4
  • 17
  • Oh dear, I may have been too quick to cast a dupe vote. This may be an actual Java issue and not an html issue. My apologies. – corsiKa Nov 07 '17 at 00:40
  • Its working fine with html and JavaScript, but I am 1 day new to java hashmap and jsp @corsiKa – tx-911 Nov 07 '17 at 00:42

0 Answers0