Sunday, 15 February 2015

php - Radio button inside two foreach loops not getting checked -


My code works like this if a parent product has two variants, it creates two div (one hidden) When I click on the radio button, its relevant div & amp; Hides the other.

Now on page load, the property checked by default does not work on any radio button.

Here's my code:

  $ PID = 2; ($ Line ['id'] = $ pid] {? & Gt; Style = 'e-mail' Do not display anything; ' & Lt ;? Php}? & Gt; & Gt; "; ['Name']; $ version = $ db- & gt; queries (" SELECT * FROM products where pid = $ pid "); ($ $ Pid == $ r ['id']); { // I have checked it, the condition is right echo "input type = 'radio' checked & gt;" $ r ['name'];} Else {echo "& lt; Input type = 'radio' & gt; ". $ R ['name'];}}}  

In addition, when I click on other radio buttons, its relevant div And hides the other, but there is no radio button again.

Any help will be appreciated.


No comments:

Post a Comment