Re: [fw-general] two problems with zend form

2008-06-25 Thread DaveCool

Ok nevermind. I found out about the ViewScript decorator. That made things a
lot easier. 

For anyone reading this who is trying to create a complicated form, this
article http://devzone.zend.com/article/3450-Decorators-with-Zend_Form

was a big help...just make sure to use $this-element, not $this-form as it
says in the article. That caused a few headaches trying to fix.

-Dave


DaveCool wrote:
 
 The first is pretty simple...
 
 

-- 
View this message in context: 
http://www.nabble.com/two-problems-with-zend-form-tp18096470p18115903.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] two problems with zend form

2008-06-24 Thread DaveCool

The first is pretty simple. I have a form element, (a select element), and I
want to add a class to it, but for some reason it is also adding the class
to the label. I really only want the class for the select drop down box.
here's the code:

$age = $this-addElement('select', 'your_age',  
array('label' = $this-translate-_('Select your age'),
 'class' = 'small-drop-down'));
$age = $this-getElement('your_age')

-addMultiOptions($this-theAgeRangeOptions)
 -setIsArray(false);
$age-setDecorators($firstColDecorators);

this is outputting: 

label for=your_age class=small-drop-down optionalSelect your
age/label
select name=your_age id=your_age class=small-drop-down
...
/select

Is there an easy way around this?

my second question is a bit more complicated, but I basically just want to
create an h3 header for my form, and I was able to add an h3 tag to my form
using the HtmlTag decorator, and prepending it to one of my select box
elements. The only problem is I don't know how to add content inside the
tag. I'm not sure if that makes sense, but here's the code:

$childrenAge = $this-addElement('select', 'ageOfChildren',  
array('label' = $this-translate-_('Age'),
  'class' = 'small-drop-down'));
$childrenAge = $this-getElement('ageOfChildren')

-addMultiOptions($this-theChildAgeRangeOptions)
 -setIsArray(false);
$childrenAge-setDecorators(array(
array('ViewHelper'),
array('Label'),
array('HtmlTag', array(
  'tag' = 'li',
  'openOnly' = true
)),
array(array('ulTag' = 'HtmlTag'), 
  array('tag' = 'ul',
'openOnly' = true,
'class' = 'float-left'
)),
array(array('headerTag' = 'HtmlTag'), 
  array('tag' = 'h3'
)),
array(array('fieldsetTag' = 'HtmlTag'), 
  array('tag' = 'fieldset',
'openOnly' = true
))
));

$childrenHeader = $childrenAge-getDecorator('headerTag');  //set up
h3 tag for separate styling
$childrenHeader-setOption('placement', 'prepend')
  -setOption('content', $this-translate_('Children:'));
//something like this maybe? (this doesn't work though)


the h3 tag renders in front of the select tag but just as h3
content=Children:/h3
Any help would be greatly appreciated.


-- 
View this message in context: 
http://www.nabble.com/two-problems-with-zend-form-tp18096470p18096470.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] zend_form help!

2008-06-10 Thread DaveCool

Hi everyone, I'm new to the forum and Zend_framework so hopefully this
doesn't sound stupid. 

I'm working with zend_form to make a signup page and at the bottom I need to
put a check box for agreeing to the terms of use. I need to make the terms
of use a link to the terms of use page, but it seems like zend form doesn't
allow html within a label tag. Is there any way around this? any help would
be greatly appreciated.

here's the snippet of code from my form, and the output.
(I attached it because the anchor tags were rendering as links. heh)
http://www.nabble.com/file/p17670427/code.txt code.txt 
-- 
View this message in context: 
http://www.nabble.com/zend_form-help%21-tp17670427p17670427.html
Sent from the Zend Framework mailing list archive at Nabble.com.