获取单选按钮的空白值

时间:2017-08-08 18:56:09

标签: php html

尝试通过Post检查我的PHP中检查了哪个单选按钮但由于某种原因,我没有得到任何价值。有没有其他人看到我错在哪里?经过一些验证后,表单通过javascript提交。如果需要,我可以提供该代码。

按钮组HTML:

<!-- Start Purchase Radio -->
    <div class="form-group">
        <div class="radio">
            <label>
                <input type="radio" name="transType" id="transTypePurchase" value="purchase">
                Purchase
            </label>
        </div>
    </div>
<!-- End Purchase Radio -->

<!-- Start Refinance Radio -->
    <div class="form-group">
        <div class="radio">
            <label>
                <input type="radio" name="transType" id="transTypeRefinance" value="refinance">
                Refinance
            </label>
        </div>
    </div>
<!-- End Refinance Radio -->

<!-- Start Transfer Radio -->
    <div class="form-group">
        <div class="radio">
            <label>
                <input type="radio" name="transType" id="transTypeTransfer" value="transfer">
                Transfer
            </label>
        </div>
    </div>
<!-- End Transfer Radio -->

<!-- Start Other Radio -->
    <div class="form-group">
        <div class="input-group">
            <span class="input-group-addon">
                <input type="radio" aria-label="Radio button for following text input" name="transType" id="transTypeOther">
            </span>
            <input type="text" class="form-control" aria-label="Text input with radio button" name="transType" id="transcationOtherText" onfocus="otherTextBox(transcationOtherText);" placeholder="Other">
        </div>
    </div>
<!-- End Other Radio -->

PHP:

if(isset($_POST['transType'])) {
    $value = $_POST['transType'];
    echo "*" . $value . "*";
}

1 个答案:

答案 0 :(得分:2)

您具有与文本输入的无线电输入相同的名称。参见

AcquireTokenAsync

更改上述输入的名称。