dongqun1656 2017-02-16 08:47
浏览 59
已采纳

变量未通过IE发送到服务器

I am using checkboxes on one page on my website and I'm trying to be able to see the checked one(s) with PHP.

Here's the code:

<input id=checkBoxChrome form="saveform" type="checkbox" name="checkbox[]" value="Chrome" checked >

And the associated PHP:

public function save(Request $request) {
    if (count($request->checkbox) == 0) {
        \Session::flash ( 'error', 'Choose one browser minimum' );
        return Redirect::back();
    }

    $this->saving($request);

    $this->saveConfigs($request);

    \Session::flash ( 'success', 'Scenario saved.' );

    return redirect ( '/testscenarios' );
}

On Firefox and Chrome this code returns a success but it returns an error on IE. After some investigation I found that $request->checkbox returns the checkboxes in Chrome and Firefox, but nothing with IE.

Any idea why?

The command dd($request->all()); gives me the following result:

array:3 [▼
  "_token" => "TfE0jjLcxsAc69kWjTPAVL9BfJBTBjPILJP2rDqm"
  "scenario" => "6"
  "scripts" => "[[{"id":18,"elementid":51,"token":"","deleted":false},{"id":16,"elementid":52,"token":"","deleted":false}]]"
]
  • 写回答

1条回答 默认 最新

  • dongzhang8680 2017-02-27 08:49
    关注

    Okay so I found where the problem was coming from! The attribute form="saveform" is not supported by IE (HTML5) and it is with the two other browsers.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100