小编boh*_*ida的帖子

在同一页面上使用多个表单进行 Laravel 请求验证

我在同一页面上有三种不同的表格。所有输入都有自己的验证规则,请求文件中的代码具有如下结构:

public function rules()
{
    return [
        //
        'sold'  => 'required',
        'unit_in_stock'  => 'required',
        'unit_price_gbp' => 'required',
        'returned_item'  => 'required',
    ];
}


public function messages()
{
    return [
        'sold.required' => 'Please enter quantity of sold parts',
        'unit_in_stock.required' => 'Please enter quantity of sold parts',
        'unit_price_gbp.required' => 'Please enter price in GBP',
        'returned_item.required' => 'Please enter quantity of items',
    ];
}
Run Code Online (Sandbox Code Playgroud)

但是当我尝试提交三个表单之一时,另一个表单返回有关空字段的消息。这种形式彼此不相关。

这是页面的截图 表格错误

这是我的表格:

{!! Form::open(['url' => route('addDelivery.addDelivery'),'class'=>'contact-form','method'=>'POST']) !!}

    <label>Price in GBP &#163;:</label>
    {!! Form::text('unit_price_gbp', isset($price->unit_price_gbp) ? $price->unit_price_gbp : old('unit_price_gbp'), array('class'=>'form-control'), …
Run Code Online (Sandbox Code Playgroud)

laravel laravel-5 laravel-validation laravel-form laravel-request

5
推荐指数
1
解决办法
2051
查看次数

在小册子中为圆形标记添加静态标签

我正在尝试在Leaflet中为我的圆圈标记添加其他标签.

所以现在我喜欢这个: 没有标签的地图上的圆圈

但我需要有这样的表情: 圈子在地图上的标签

这是我的代码部分:

var Classroomsbyamount = new L.LayerGroup();
var Classroomsamount = new L.geoJson(buildingPoints, { 
    pointToLayer: function(feature, latlng) {
        if(feature.properties.Classroomsstyleamt) {
        return new L.CircleMarker(latlng, feature.properties.Classroomsstyleamt, {radius: feature.radius}); }
    }, 
    onEachFeature: function(feature, layer) { 
        if (feature.properties && feature.properties.building_name) { 
            var thenumber20 = feature.properties.spacecategoryClassroomsamt; 
            var number30 = thenumber20.toLocaleString('en');
            layer.bindPopup({ html: '<b>' + number30 + '</b>' });
            layer.bindPopup(feature.properties.building_name + "<br> Amount:" + number30, {maxWidth: "none", closeButton: true, offset: L.point(0, -20)});
            layer.on('mouseover', function() { layer.openPopup(); }); 
            layer.on('click', function() { 
                var capacityGroup = feature.properties.building_name;
                popUp(capacityGroup); …
Run Code Online (Sandbox Code Playgroud)

javascript jquery leaflet

4
推荐指数
1
解决办法
3650
查看次数