Welcome Guest, Not a member yet? Register   Sign In
ajax wih CodeIgniter

Hi all,i'm trying to create 3 textfield with CI by using form_input. One is for enter price,one is for enter the desire discount value,the last one is for the discounted price which is calculated from price and discount value..How do i achieve it with CI?Thanks a lot..

No need for ajax or special CI feature, just use simple [removed])

I have the impression, that people tend to forget about old school coding whenever they hear "...framework..." ^^

What should i do then?Thanks...

Try something along this lines:
<5cr1pt >
function update_disc_price()
  var new_value = $('price').getValue() - $('discount').getValue();
</5cr1pt >
&lt;input name="price" id="price" value=""&gt;
&lt;input name="discount" id="discount" value=""&gt;
&lt;input name="disc_price" id="price" value="" /&gt;
Be aware, that this example uses the prototype framework and this can be done with "normal" js aswell, but I'm just to lazy to look the functions Wink

My example propably won't work, but you should be able to work with this...I guess.

How about using form_input?Is it possible to do it too?Thanks waldmeister..

yes you can do with form_input here is example


Where should i put the function?Is it on the view?Thanks..

[eluser]Zack Kitzmiller[/eluser]
You're _really_ over-complicating this. Just use a little bit of old-fashioned [email protected]

How to do it with old fashioned javascript?Thanks..

Theme © iAndrew 2016 - Forum software by © MyBB