I have a 2 pages, first page with a form
<form action="index.php/moneyexchange/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">Borrow</a>
</form>
And in the second page I have a slider using KNOCKOUT JS functionality.
<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;">
What I want to do is get the Amount value from the first page and show it on the knockout js sliders. Right now I am showing in the sliders a value of 2500.
self.amount = ko.observable(2500);
var amount = ko.observable(2500);
self.formatter1 = function(amount) {
return amount + ' kk';
}
Can someone help me in how to get the value from the first page and add to the observable of second page so the sliders start with that value. Thanks for the help. I dont mind if I can even bring the data from cookies, but what I am trying to do normally right now is load this data, to codeigniter controller like this,
public function save_userinput(){
$this->load->helper('form');
$form_data = $this->input->post();
}
And then initialize it in the knockout js File which I have, but I need a proper way of doing it.