自定义表单,计算答案然后更新mysql DB

What I'm trying to achieve is a mock payment system for when users purchase tokens. The part I'm stuck on is, creating a custom form displaying 3 options to buy packs of tokens in preset amount, or for the user to use a slider. Obviously not both at the same time. I just have no idea how to do this, my first attempt I did try using html form and html slider however I couldn't get that to pass to the php so I removed it.

Here is my current code for the view and the method in the controller. Using yii framework

View:

<?php
/* @var $this TokensController */
/* @var $model Tokens */

$this->breadcrumbs = array(
'Tokens' => array('index'),
$model->TokenID => 
'buy',
);


?>

 <h1>Buy Tokens </h1>

<?php $this->renderPartial('_form', array('model' => $model)); ?>

Controller:

public function actionBuy() {

    $_id = Yii::app()->user->getId();
    $model = Tokens::model()->findByAttributes(array('UserID' => $_id));
    if ($model === null)
        throw new CHttpException(404, "Keep calm! If you havent bought tokens before this is normal");

    $this->render('buy', array(
        'model' => $model,));

//        $qty = $_POST['tkamount'];
//        $newtkamount = ($_model->TokenAmount + $qty);
//        echo $qty . $newtkamount;
    }

I don't know about Yii, but I'd use some JQuery magic.

Make 2 radiobuttons, where user can select if he wants to pay fixed amounts or use a slider. Using JQuery, you now disable/enable the controls the user wants when he clicked the radio buttons. When sending the data, simply send all of it, including the radiobutton setting, and then in the PHP filter out which method he didn't want and there you go.

http://api.jquery.com/change/ <- Use to monitor when radiobuttons are clicked