我需要收到多个同名复选框值并在laravel 5.2中插入db。
我的表格行:标记名,postid
提前谢谢。
答案 0 :(得分:0)
请遵循以下示例:
function getLargestValue()
{
var ss=SpreadsheetApp.getActiveSpreadsheet();
var sheets=['Sheet1','Sheet2','Sheet3'];
var values=[];
for(var i=0;i<sheets.length;i++)
{
var sht=ss.getSheetByName(sheets[i]);
var rng=sht.getDataRange();
var rngA=rng.getValues();//this will give you a 2D array
for (var items in rngA) //foreach loop, easier than for loop
{
var result = rngA[items][0].substring(2);//split string at 2nd character
if(!isNaN(parseFloat(result)) && isFinite(result))// check whether it is a number (since cell has strings like "Values")
{
values.push(result);//adds all numbers to the array
}
}
}
values.sort(function(a, b) {return a - b;});
var max = values[values.length-1];
//SpreadsheetApp.getUi().alert('The max is ' + max); //Just checking to be sure it works
//return max;
// must show the largest value on "Max" sheet
ss.getSheetByName('MAX').getRange("A2").setValue(max)
}
在控制器中:
<form action="{{url('submitdata')}}" method="post">
{!!csrf_field()!!}
<lavel for="subject1">Bangla</label>
<input id="subject1" name="subject[]" type="checkbox" value="Bangla"/>
<lavel for="subject1">English</label>
<input id="subject1" name="subject[]" type="checkbox" value="English"/>
</form>