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調用函數,但我不確定哪個應該起作用。