1

我正在尝试发布一个单选按钮值,但我一定犯了一个非常愚蠢的错误。我使用 Kohana 和 Bootstrap 作为框架。这是我的代码;

<div class="control-group">
<label class="control-label">Geslacht</label>
<div class="controls">
    <div class="input-prepend">
      <span class="add-on"><i class="icon-heart"></i></span>
         <div class="btn-group geslacht" data-toggle="buttons-radio">
            <input type="button"  name="Geslacht" value="M" class="btn"/>
            <input type="button"  name="Geslacht" value="V" class="btn"/>
         </div>
    </div>
</div>

这是我的控制器

$check1->values(array(
'RelatieID'     => $relatie->pk(),
'AdresID'       => $check->pk(),
'Voornaam'      => $_POST['Voornaam'],
'Voorletters'   => $_POST['Voorletters'],
'Tussenvoegsels'=> $_POST['Tussenvoegsels'],  
'Achternaam'    => $_POST['Achternaam'],  
'Geslacht'      => $_POST['Geslacht'],
'Geboortedatum' => date('Y-m-d', strtotime($_POST['Geboortedatum']))
));
4

1 回答 1

2

if you want to use radio button you should change

<input type="button"  name="Geslacht" value="M" class="btn"/>
<input type="button"  name="Geslacht" value="V" class="btn"/> 

to:

<input type="radio"  name="Geslacht" value="M" class="btn"/>
<input type="radio"  name="Geslacht" value="V" class="btn"/>

List of Input type

List of allowed/valid input type at http://dev.w3.org/ on 11/06/2013

ⓘ input type=text
ⓘ input type=password
ⓘ input type=checkbox
ⓘ input type=radio
ⓘ input type=button
ⓘ input type=submit
ⓘ input type=reset
ⓘ input type=file
ⓘ input type=hidden
ⓘ input type=image
ⓘ input type=datetime 
ⓘ input type=datetime-local 
ⓘ input type=date 
ⓘ input type=month 
ⓘ input type=time 
ⓘ input type=week 
ⓘ input type=number 
ⓘ input type=range 
ⓘ input type=email 
ⓘ input type=url 
ⓘ input type=search 
ⓘ input type=tel 
ⓘ input type=color 
于 2013-11-06T12:44:46.493 回答