Skip to content
Advertisement

How to check or uncheck the radio button according to value in php?

I am stuck on the issue. I have two radio buttons. One is a Buyer and the second is the Seller.

JavaScript

The Buyer radio button is already checked.

Now What I am doing is, I have the below code, and if the $account_type==2 then I have to select the seller radio button and unchecked the buyer.

I tried the below code

JavaScript

Advertisement

Answer

Here’s the correction with the added empty() check.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement