Echo check on which checkbox was checked

前端 未结 1 1364
忘掉有多难
忘掉有多难 2021-01-29 08:04

I have a form where i can edit the content, at this point i\'m echo\'ing the value of a checkbox into an input field but i rather keep the original checkbox\'s and show which on

相关标签:
1条回答
  • 2021-01-29 08:41

    while not elegant on every input you can add

    <input type="radio" class="px" name="radiochoice" id="radio7" class="radio" value="185.00"  <?php if($_POST['radiochoice'] =='185.00'){echo "checked='checked'";} ?>/>
    

    alter the value accordingly, and it may be $_GET, depending on form action

    0 讨论(0)
提交回复
热议问题