頁面url拼接以及頁面跳轉javascript
var baseUrl = '<?php echo Yii::$app->request->baseUrl ?>';
var url = baseUrl + '/index.php?r=itsp01-dat-enterprise-info';
window.location.href = url;
javascript:void(0)不執行連接
當前年度開始,到下一年爲止的下拉框
$year=date('Y');
$arr=array();
$j=0;
for($i=2017;$i<=$year+1;$i++){
$arrs=array();
$arrs['id']=$i;
$arrs['name']=$i;
$arr[$j]=$arrs;
$j++;
}
bootstrap 用class設置滾動條,包裹住gridview
.ft02Overflow2{
overflow-y:scroll;
height: 276px;
width: 800px;
}
js checkbox是否選中
function checkRight(){
var count = 0;
var checkArry = document.getElementsByName("selection[]");
for (var i = 0; i < checkArry.length; i++) {
if(checkArry[i].checked == true){
count++;
}
}
if( count == 0 ){
alert("<?=Tools::getErrorMessage("ERR_0014",'未割當學生') ?>");
}
}
bootstrap gridview 設置列寬
'contentOptions'=>['style'=>'min-width:100px'],
比較時間js
var stdt=new Date($psday.value.replace("-","/"));var etdt=new Date($peday.value.replace("-","/"));if(stdt>etdt){ $("#msgpsday").prop("hidden",false); return false;}