我在同一页面上有三种不同的表格。所有输入都有自己的验证规则,请求文件中的代码具有如下结构:
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 £:</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
我正在尝试在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)