【发布时间】:2016-09-16 15:00:02
【问题描述】:
我正在尝试将值从我的 php 表单传递到我的 php 文件。 我的html代码如下
<form>
<div class="form-group col-md-2">
<div class="form-group col-md-2">
<label for="EndDateSearch">Date range end date</label><br/>
<div class="sandbox-container" id="req_end_date">
<div class="input-group date form_datetime">
<input name="EndDateSearch" type="text" class="form-control" placeholder="Select date" ng-model="EndDateSearch">
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>
</div>
</div>
</div>
<div class="input-group-btn form-group col-md-2">
<button ng-click="searchWr(EndDateSearch)" class="btn btn-default" type="submit"><b>SEARCH</b>
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
<form>
如果跟随我的 angularJs 代码
$scope.searchWr = function() {
$http.post("search_data.php", 'EndDateSearch': $scope.EndDateSearch
})
.success(function(myData) {
$scope.myRequestAlldata = myData;
});
};
我的 search_data.php 包含以下代码:
if(isset($data->EndDateSearch)){
echo $EndDateSearch=$data->EndDateSearch;
}
问题是,如果我从文本框中传递日期,它不会将任何值传递给 search_data.php,除了日期,它的工作正常。我的代码有什么问题吗?
【问题讨论】: