Zend +/- buttons to increase or decrease value

时间:2016-02-12 21:29:54

标签: php zend-framework

I currently have a Zend form where you add data into a number field. But I want to add 2 buttons where you can increase or decrease the value then Submit the data.

Current code :

randomPoint()

Is it possible to edit that code, or would I need to find another solution?

EDIT: My mistake, not radio buttons.

1 个答案:

答案 0 :(得分:0)

The best way to achieve that is to create your own Form Element helper extends the Zend\Form\View\Helper\FormNumber helper.

You can modify the render, and add your +/- buttons (with javascript action to increase or decrease your element value) to erase the render() method.