views:

356

answers:

1

Hello,

Ultimately here is my goal. Using Zend_Form I want to turn this idea http://www.sohtanaka.com/web-design/fancy-thumbnail-hover-effect-w-jquery/ into a list of radio buttons.

Kind of using this concept. http://theodin.co.uk/tools/tutorials/jqueryTutorial/fancyRadio/

I know there has to be a way to do this but I can't seem to figure anything out! Any ideas?

Thanks! -d

A: 

Why do you think there has to be a way?

Did you have a look at the source code? The second one might be done using custom decorators. Have a read about that:

http://framework.zend.com/manual/1.10/en/learning.form.decorators.html

More added after clarifying question:

I had a similar problem where I needed to add a preview button to each radio button. What I did was insert the complete html into the array passed to setMultiOptions. The list is dynamic. Each item on the list is defined elsewhere in the app and stored in the database. When defining these options, the user can specify to up load a file. This file forms part of the url in the a tag. Here is a bit of SQL to help explain what I mean:

function readAllObjlistitemPairpreview($id)
{
    // get all objlistitem rows that belong to a certain list
    $id = (int)$id;
    $select = $this->getAdapter()->select()->from(array('li' => 'objlistitem'), array())->join(array('i' => 'objitem'), 'li.objitem = i.id', array('id' => 'li.objitem', 'name' => "CONCAT(i.name, ' <a href=\"', i.url, '\">url</a>')"))->where('li.objlist = ?', $id);

    //return $this->getAdapter()->fetchAll($select);
    return $this->getAdapter()->fetchPairs($select);
}

You could do something similar with an img tag. The array that this function returns can be passed to setMultiOptions: $radio->setMultiOptions($array);

HTH

sims
My fault for not adding more information. Here is a more accurate description of where I am at. I can easily create a ViewScript file to customize my radios. The problem is that i'm not sure how to pull in things like links and images for each option. Pulling in a link and a image for the whole radio element is no problem.
Davy
I see. I've added more to the answer.
sims