0
这是一个以前问过的问题,但我需要严重的帮助,所以从朋友张贴它。我在这里有一个输入字段。从输入值到codeigniter控制器并初始化在knockout.js
<form action="index.php/money/save_userinput" method="post" >
<input type="text" placeholder="Amount in €">
<a type="submit" style="background-color:#fff; color:#66cccc;" href="<?php echo base_url();?>index.php/money/firstpage">GetCash</a>
</form>
然后我尝试从输入字段获取该值到调试时没有收到任何值的控制器。这是功能。
public function save_userinput(){
$this->load->helper('form');
$form_data = $this->input->post();
}
什么我想现在要做的是使用从第一页的价值并获得一个完全不同的页面在淘汰赛JS滑块的值。 这是滑块代码。
<input id="ex2" data-slider-id="ex2Slider" type="text" data-bind="sliderValue: {value: amount, min:0, max: 5000, step: 1, tooltip: 'always', formatter:formatter2}"
style="display: none;">
而且我有一个淘汰赛JS网页,其中所具有的功能,
self.amount = ko.observable(2500);
self.formatter1 = function(amount) {
return amount + ' kk';
}
我需要把该值我从控制器进入观察到的,但我不知道怎么在做所有,我尝试了不同的方法,但没有工作。我正在考虑用Ajax调用函数,但我不确定哪个应该起作用。