每个自定义字段在此上下文中都需要具有唯一名称?

时间:2018-06-06 10:30:47

标签: laravel

我有一个可以拥有自定义字段的表单。这个字段可以是任何东西,你的电子邮件是什么?,你的邮政编码是什么?等等。是否可以使用所有字段的名称,然后在php / laravel中妥善存储答案表中的问题答案?或者每个自定义字段都需要具有唯一名称?

<form method="post" action="">

    <div class="form-group">
        <label for="custom_field">Whats your email?</label>
        <input type="text" name="custom_field" class="form-control" required="">
    </div>

    <div class="form-group">
        <label for="custom_field">Receive newsletter?</label>
        <div class="form-check">
            <input type="radio" name="custom_field[]" value="rad1" class="form-check-input">    
            <label class="form-check-label" for="exampleCheck1">rad1</label></div> 
        <div class="form-check">
            <input type="radio" name="custom_field[]" value="rad2" class="form-check-input">    
            <label class="form-check-label" for="exampleCheck1">rad2</label></div>
        </div>
    </div>  
   <!-- more custom fields -->
<input type="submit" href="#step2" value="Store">
</form>

0 个答案:

没有答案