Zend Framework Forum

Go Back   Zend Framework Forum > Zend Framework General discussions > Resources for Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-13-2009, 10:56 PM
Junior Member
 
Join Date: Apr 2009
Location: Albany NY USA
Posts: 3
Default Radio buttons

Hi I am trying to create radio buttons on zend this is the way i want to do it.

()Yes ()No Jonh Smith
()Yes ()No Peter Fallon

I want to attach two radio buttons to one id.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-14-2009, 09:34 AM
Junior Member
 
Join Date: Apr 2009
Location: The Netherlands
Posts: 9
Send a message via MSN to Regx
Default Place this code in your view

Place this code in your view:
[PHP]
<p>
<?= $this->formRadio('johnsmith', '1', array(), array('1' => 'Yes', '0' => 'No'), ' '); ?>
&nbsp;&nbsp;<strong>John Smith</strong>
</p>
<p>
<?= $this->formRadio('peterfallon', '1', array(), array('1' => 'Yes', '0' => 'No'), ' '); ?>
&nbsp;&nbsp;<strong>Peter Fallon</strong>
</p>
[/PHP]

Which will output exactly the same as you described:
[HTML]
<p>
<label for="johnsmith-1">
<input type="radio" name="johnsmith" id="johnsmith-1" value="1" checked="checked">
Yes</label>
<label for="johnsmith-0">
<input type="radio" name="johnsmith" id="johnsmith-0" value="0">
No</label>
&nbsp;&nbsp;<strong>John Smith</strong>
</p>
<p>
<label for="peterfallon-1">
<input type="radio" name="peterfallon" id="peterfallon-1" value="1" checked="checked">
Yes</label>
<label for="peterfallon-0">
<input type="radio" name="peterfallon" id="peterfallon-0" value="0">
No</label>
&nbsp;&nbsp;<strong>Peter Fallon</strong>
</p>
[/HTML]

I know, there isn't enough documentation about some of the form view helpers out there...
You need to take a look at the sourcecode sometimes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-14-2009, 04:32 PM
Junior Member
 
Join Date: Apr 2009
Location: Albany NY USA
Posts: 3
Default

You are right is not that many Thanks for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-14-2009, 04:54 PM
Junior Member
 
Join Date: Apr 2009
Location: The Netherlands
Posts: 9
Send a message via MSN to Regx
Default

Your welcome
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 02:59 AM.


Designed by: Miner Skinz Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0