how to show the radio button is selected is still ticked?

后端 未结 2 1065
轮回少年
轮回少年 2021-01-28 12:25

my app has 2 radio buttons, when user ticks any of it, the value of the ticked radio button gets saved in the table via ajax, now the problem is, when user gets back to the page

2条回答
  •  天命终不由人
    2021-01-28 13:05

    When you are rendering the page for the user in PHP you would need to do a query to where you have saved the selection (presumably a database). If the user has selected that particular radio button then you would display it as selected. Code would be something like:

    // Do a database query or something to get the value that the user has stored before (if any)
     Gallery Link....
    Category Link....

提交回复
热议问题