Yii Framework Forum: modify form value with ajax - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

modify form value with ajax Rate Topic: -----

#1 User is offline   Nikopon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 04-April 12

Posted 20 April 2012 - 03:15 AM

Hi,

I have a couple of forms in the view and they are related like

form A:price
form B:tax

and

form B = form A * tax rate(tax rate is defined in the constant, like 0.05%)

And value of form A is validated with ajax in real time.

if(isset($_POST['ajax']) && $_POST['ajax']==='price-form'){
	echo CActiveForm::validate($model);
	Yii::app()->end();
}



If someone input the number in form A, I wanna calculate the tax automatically and
put the result in Form B without erasing validate function.
But completely no idea how I can do it.
(This is so frustrated to take a meal 6 times a day.)

Please tell me the way to let my mind stable.

Guess make some code to modify json response...
0

#2 User is offline   canailla007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 06-January 13

Posted 20 July 2013 - 05:35 PM

Can you solve it?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users