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

匿名 (未验证) 提交于 2019-12-03 02:03:01

问题:

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

Male "> Female ">  

If in database its female it should be in checked state female radio button else male radio button its not checking the value for none

回答1:

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:

    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> 


回答2:

update Radio Button in jsp:- Code:- >Male

>Female



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!