How to retrieve radio button value from database in checked state in jsp

前端 未结 2 1164
深忆病人
深忆病人 2020-12-18 11:09

How to retrieve radio button values with checked state in jsp ? while updating radio button from data base.

Male 

        
2条回答
  •  天涯浪人
    2020-12-18 11:46

    Try to use JSTL & EL instead of Scriplet elements. For database access use JSTL SQL Tag library or it's better to move the database code in the Servlet.

    Try with the CSS Input Radio checked Property

    Sample code:

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    
    
    
    Male checked>
    Female checked>
    

    Have a look at the similar post


    EDIT

    For check box values single value its show properly but when it multiple values showing nothing.

    check the string using contains method.

    sample code:

    
    
    English
    checked>
    Kannada
    checked>
    Hindi
    checked>
    

提交回复
热议问题