Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
I tried most of your code and all generated labels are clickable. So, I'm not sure what is your actual issue is. Maybe you're outputting inputs for the same field more than once? On Thursday, November 3, 2011 10:22:53 PM UTC+7, dave wrote: > > Just a quick typo fix on that last statement...after the > Sooadded the number 6 on the input id. That's how > it should read... > > value="Y"> > Yes > value="N"> > No The label "for" attribute should use the key of $options, not the value. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Rudeness (was: Re: Making radio button labels clickable)
I guess the main problem with this list is the lack of "modern" post markup. With too much code as "plain text" it gets really hard to read and comprehend. I start to think that a google group is not the right board for code related issues. at least consider the possibility to post your issue at http://stackoverflow.com/questions/tagged/cakephp you could still re-link it here or sth. but "foreign" links (pastebin,...) are still links outside of this context, can be unreachable etc. so that's not ideal, either. the group is perfect for more general topics or with only a few lines of code. but other than that it is not really made for developers (especially web developers). as for the rudeness: 99% of all questions asked in a appropriate way get an appropriate answer. I sometimes catch myself writing a little bit too rude and regret this some time later on. But in the heat of the moment I am asking myself "How can someone have such a lack of communication skills and common sense" if he posts sth like "HELP ME. Please program me a messaging plugin. thank you". It's annoying - to all of those. Yes, its a good practice to test your own "patience" with this patient. But sometimes its just too annoying. I am certainly not saying that rudeness of a thread starter should be treated with rudeness. But it is not only the fault of administrators or contributors - the thread starter has a show a certain respect for the group and the members of it, as well. and this is most certainly not always the case. As I said: A serious and good outlines question (that also shows that you at least tried to come up with a solution yourself for trivial issues) has always been treated as one. As far as I remember the last years. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Rudeness (was: Re: Making radio button labels clickable)
Disagree. For starters - rather than creating a new thread by changing the subject, why didn't you just reply in the existing thread? I had to go back and take a look at what you were talking about. Secondly the responses in that thread don't look rude at all. Helpful suggestions for getting helpful responses (keep it brief, use pastebin etc). I've always gotten helpful, quick responses to questions - even when my questions have been borderline moronic. That said people are volunteers, and are busy - so they are entitled to be frustrated when people do silly things (like respond directly to people via mail, repeat questions that have been answered dozens of times etc). I've been on far less helpful lists (lists which are moderated - asking a simple question never even makes it to the list. Simple questions getting asked because of poor documentation never ever get answered). Don't confuse short, sharp, to the point responses as "rudeness". People don't often have the time to reply to responses with essays... On Fri, Nov 4, 2011 at 11:28 AM, Ryan Schmidt wrote: > > On Nov 3, 2011, at 11:51, Jeremy Burns | Class Outfit wrote: > > > This is one of the most friendly and responsive forums > > No, sorry. This is by far the rudest and least helpful list I've ever been > on. The fact that that rudeness is often perpetrated by the administrators > of the list means this is part of the culture of this list and is emulated > by other list contributors. I've lost could of how many times I've seen > someone post a question only to receive a dozen rude / unhelpful / snarky > replies. Yes, people need to be educated about how to ask helpful questions > that better enable people to help them. But it is possible to do that > without insulting them. > > One of the authors of Subversion (a program I use, and whose mailing list > I also participate in) wrote a book, Producing Open Source Software. You > can read it online for free: > > http://producingoss.com/ > > Not tolerating rudeness is one of the tenets of a good open source project > that's talked about in the book: > > http://producingoss.com/en/setting-tone.html#prevent-rudeness > > Notably, this section is written from the perspective that a project > administrator would be the one reigning in the rudeness of another list > member. The idea that a project administrator could be the one perpetrating > the rudeness is so outlandish that it does not appear to have occurred to > the author. > > Clearly the people being rude on this list either do not realize that they > are being rude, or do not see a problem with being rude to people who have > come to seek help in a discussion group created specifically for that > purpose; either problem is alarming. > > I suggest the administrators and contributors of this list and this > project seriously reconsider their manner of interacting with their users > if they want to stop alienating large portions of their userbase. > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Rudeness (was: Re: Making radio button labels clickable)
On Nov 3, 2011, at 11:51, Jeremy Burns | Class Outfit wrote: > This is one of the most friendly and responsive forums No, sorry. This is by far the rudest and least helpful list I've ever been on. The fact that that rudeness is often perpetrated by the administrators of the list means this is part of the culture of this list and is emulated by other list contributors. I've lost could of how many times I've seen someone post a question only to receive a dozen rude / unhelpful / snarky replies. Yes, people need to be educated about how to ask helpful questions that better enable people to help them. But it is possible to do that without insulting them. One of the authors of Subversion (a program I use, and whose mailing list I also participate in) wrote a book, Producing Open Source Software. You can read it online for free: http://producingoss.com/ Not tolerating rudeness is one of the tenets of a good open source project that's talked about in the book: http://producingoss.com/en/setting-tone.html#prevent-rudeness Notably, this section is written from the perspective that a project administrator would be the one reigning in the rudeness of another list member. The idea that a project administrator could be the one perpetrating the rudeness is so outlandish that it does not appear to have occurred to the author. Clearly the people being rude on this list either do not realize that they are being rude, or do not see a problem with being rude to people who have come to seek help in a discussion group created specifically for that purpose; either problem is alarming. I suggest the administrators and contributors of this list and this project seriously reconsider their manner of interacting with their users if they want to stop alienating large portions of their userbase. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
We're all ears and eyes. Jeremy Burns Class Outfit http://www.classoutfit.com On 3 Nov 2011, at 17:00, dave wrote: > Thanks Jeremy. Ok cool will do. Mind if I shorten it (massively) and > re-post? > > Cheers > > Dave > > P.s. Apologies to AD > > On Nov 3, 4:51 pm, Jeremy Burns | Class Outfit > wrote: >> Dave - the posts were too long; long ones don't get read or responded to. >> >> This is one of the most friendly and responsive forums, but you have give us >> a break. We're all busy. Brevity and bin posts are grat. >> >> Jeremy Burns >> Class Outfit >> >> http://www.classoutfit.com >> >> On 3 Nov 2011, at 16:44, dave wrote: >> >> >> >> >> >> >> >>> 1. The typo was made in a section of code as I'd like to see it, not >>> actual code. so I was unable to cut and paste. >> >>> 2. This is entirely about how cakephp generates html, not the html >>> itself...that's the easy bit. >>> 3. Yes the message is long - I wanted to cover all aspects, and >>> offered numerous examples to illustrate the issue. >>> I'm a new cake user wanting to learn, that's all..I tried everything >>> prior to asking...sorry my message didn't conform, but your reply was >>> mocking at best. >>> Ah, you've posted my reply to you publicly. How very >>> friendly...thanks. That's a great welcome to the cakephp forums >>> then... >> >>> On Nov 3, 4:10 pm, AD7six wrote: On Nov 3, 4:22 pm, dave wrote: >> > Just a quick typo fix on that last statement...after the > Sooadded the number 6 on the input id. That's how > it should read... >> That's why putting code in a pastebin and sharing the link is a better idea, or in your case putting the html page somewhere and pointing at it. >> You should also ask your questions in an appropriate place - it doesn't matter if you're using cakephp to generate html; if your question is about html - ask on a html help forum. >> And: your message(s) are way too long to read >> AD >> >>> -- >>> Our newest site for the community: CakePHP Video >>> Tutorialshttp://tv.cakephp.org >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help >>> others with their CakePHP related questions. >> >>> To unsubscribe from this group, send email to >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group >>> athttp://groups.google.com/group/cake-php > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
Thanks Jeremy. Ok cool will do. Mind if I shorten it (massively) and re-post? Cheers Dave P.s. Apologies to AD On Nov 3, 4:51 pm, Jeremy Burns | Class Outfit wrote: > Dave - the posts were too long; long ones don't get read or responded to. > > This is one of the most friendly and responsive forums, but you have give us > a break. We're all busy. Brevity and bin posts are grat. > > Jeremy Burns > Class Outfit > > http://www.classoutfit.com > > On 3 Nov 2011, at 16:44, dave wrote: > > > > > > > > > 1. The typo was made in a section of code as I'd like to see it, not > > actual code. so I was unable to cut and paste. > > > 2. This is entirely about how cakephp generates html, not the html > > itself...that's the easy bit. > > 3. Yes the message is long - I wanted to cover all aspects, and > > offered numerous examples to illustrate the issue. > > I'm a new cake user wanting to learn, that's all..I tried everything > > prior to asking...sorry my message didn't conform, but your reply was > > mocking at best. > > Ah, you've posted my reply to you publicly. How very > > friendly...thanks. That's a great welcome to the cakephp forums > > then... > > > On Nov 3, 4:10 pm, AD7six wrote: > >> On Nov 3, 4:22 pm, dave wrote: > > >>> Just a quick typo fix on that last statement...after the > >>> Sooadded the number 6 on the input id. That's how > >>> it should read... > > >> That's why putting code in a pastebin and sharing the link is a better > >> idea, or in your case putting the html page somewhere and pointing at > >> it. > > >> You should also ask your questions in an appropriate place - it > >> doesn't matter if you're using cakephp to generate html; if your > >> question is about html - ask on a html help forum. > > >> And: your message(s) are way too long to read > > >> AD > > > -- > > Our newest site for the community: CakePHP Video > > Tutorialshttp://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
Dave - the posts were too long; long ones don't get read or responded to. This is one of the most friendly and responsive forums, but you have give us a break. We're all busy. Brevity and bin posts are grat. Jeremy Burns Class Outfit http://www.classoutfit.com On 3 Nov 2011, at 16:44, dave wrote: > 1. The typo was made in a section of code as I'd like to see it, not > actual code. so I was unable to cut and paste. > > 2. This is entirely about how cakephp generates html, not the html > itself...that's the easy bit. > 3. Yes the message is long - I wanted to cover all aspects, and > offered numerous examples to illustrate the issue. > I'm a new cake user wanting to learn, that's all..I tried everything > prior to asking...sorry my message didn't conform, but your reply was > mocking at best. > Ah, you've posted my reply to you publicly. How very > friendly...thanks. That's a great welcome to the cakephp forums > then... > > > > > On Nov 3, 4:10 pm, AD7six wrote: >> On Nov 3, 4:22 pm, dave wrote: >> >>> Just a quick typo fix on that last statement...after the >>> Sooadded the number 6 on the input id. That's how >>> it should read... >> >> That's why putting code in a pastebin and sharing the link is a better >> idea, or in your case putting the html page somewhere and pointing at >> it. >> >> You should also ask your questions in an appropriate place - it >> doesn't matter if you're using cakephp to generate html; if your >> question is about html - ask on a html help forum. >> >> And: your message(s) are way too long to read >> >> AD > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
1. The typo was made in a section of code as I'd like to see it, not actual code. so I was unable to cut and paste. 2. This is entirely about how cakephp generates html, not the html itself...that's the easy bit. 3. Yes the message is long - I wanted to cover all aspects, and offered numerous examples to illustrate the issue. I'm a new cake user wanting to learn, that's all..I tried everything prior to asking...sorry my message didn't conform, but your reply was mocking at best. Ah, you've posted my reply to you publicly. How very friendly...thanks. That's a great welcome to the cakephp forums then... On Nov 3, 4:10 pm, AD7six wrote: > On Nov 3, 4:22 pm, dave wrote: > > > Just a quick typo fix on that last statement...after the > > Sooadded the number 6 on the input id. That's how > > it should read... > > That's why putting code in a pastebin and sharing the link is a better > idea, or in your case putting the html page somewhere and pointing at > it. > > You should also ask your questions in an appropriate place - it > doesn't matter if you're using cakephp to generate html; if your > question is about html - ask on a html help forum. > > And: your message(s) are way too long to read > > AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
On behalf of dave again who again accidentally clicked reply to author (stop mailing me) > Why did you do that? Who do you think you are exactly? Sorry, this is going to the administrators. Sorry dave if you'd prefer silence than suggestions on how you can get help - I'm happy to oblige AD (I am one of the "administrators") -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
On behalf of dave who accidentally emailed me personally: > Hi > > This is entirely about how cakephp generates html, not the html > itself...that's the easy bit. Why do you consider it to be otherwise? > Because you didn't read it, clearly. I know how to make radio buttons > clickable in html...it's simple. > > I agree about pointing to a page somewhere and will do this in future. > > Yes the message is long - I wanted to cover all aspects. > > I find your tone derisory and quite insulting. I don't appreciate it > on a public forum. I won't publicly air my annoyance with you...just > wanted to let you know. But as a new cake user how am I supposed to > learn about cake without being able to ask the odd question? I've > tried everything prior to asking...unlike a lot of people on here. > > Now then, would you like to read it thru and maybe shed any light on > the problem? > > Or is this reply too long too? Yes -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
On Nov 3, 4:22 pm, dave wrote: > Just a quick typo fix on that last statement...after the > Sooadded the number 6 on the input id. That's how > it should read... That's why putting code in a pastebin and sharing the link is a better idea, or in your case putting the html page somewhere and pointing at it. You should also ask your questions in an appropriate place - it doesn't matter if you're using cakephp to generate html; if your question is about html - ask on a html help forum. And: your message(s) are way too long to read AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
Just a quick typo fix on that last statement...after the Sooadded the number 6 on the input id. That's how it should read... Yes No On Nov 3, 3:10 pm, dave wrote: > Hi... I posted a couple of days ago re making radio button labels > clickable...but guess my question was too long...and reading it back, > whilst accurate, it was pretty bloody boring too...sorry guys! > > (note after writing this...this too has become long - maybe not quite > as boring (I hope), but left me bamboozled.) > > I've resorted to removing id from the input altogether as I think it's > better to have nothing take place at all when clicking a label rather > than the top radio button been selected irrespective of which label in > the group is clicked. > > However...can someone please explain this to me. I'd still like to > make radio labels clickable for the appropriate radio > button...*sighs*. > On this page:http://book.cakephp.org/view/1390/Automagic-Form-Elements > , about a third of the way down (second para in 7.3.3.3), is an > example of radio buttons with ---between--- text etc. Not really > interested in the --betweens-- or --afters-- etc. Am VERY interested > in the input ids and label fors however...as they seem to render as I > want them to be... > > It looks like this: > > Form->input('field', array( > 'before' => '--before--', > 'after' => '--after--', > 'between' => '--between---', > 'separator' => '--separator--', > 'options' => array('1', '2') > ));?> > > And claims to output this (note the input->id and the label->for are > the same, thus rendering the labels clickable): > > Output: > > > --before-- > id="UserField1" /> > 1 > --separator-- > id="UserField2" /> > 2 > --between--- > --after-- > > > It doesn't do this for me. Firstly I had to add a type->radio, > otherwise I get a select...which is ok, I added 'type' => > 'radio'...but, and this is the frustrating bit...I see this being > generated: > > > --beforebetween--- > > Field > id="MemberField_" > value=""> > id="MemberField" > value="0"> > 1 > --separator-- > id="MemberField" > value="1"> > 2 > > --after-- > > > I'm in my members controller here...hence the MemberField rather than > UserField, but that's all... > > See my input->ids and label->fors? All identical. Like peas in a pod. > Like things that are indistinguishable from each other. Like twins. > Like..like...like...pah! > > Any ideas?? If anyone can help, I'd be eternally grateful...well, for > a bit anyway. > > Thanks in advance > > Dave > > Ok, so this has become long too...and it's about to get longer... > > After more trial and error, I've managed to get the labels working, > with this format: > > echo $this->Form->input('field1', array( > 'type' => 'radio', > 'options' => array('Y'=>' Yes ','N' => ' No') > )); > > which gives: > value="Y"> > Yes > value="N"> > No > > (ie appends the N to the MemberField id. By no means ideal, but it > works.) > > ...but this doesn't work (changed N to M) > > echo $this->Form->input('field2', array( > 'type' => 'radio', > 'options' => array('Y'=>' Yes ','M' => ' No') > )); > > gives > value="Y"> > Yes > value="M"> > No > > A I tried a few more examples... > > echo $this->Form->input('field3', array( > 'legend' => false, > 'type' => 'radio', > 'options' => array('Y'=>' Yes ','A' => ' Ao') > )); > echo $this->Form->input('field4', array( > 'legend' => false, > 'type' => 'radio', > 'options' => array('Y'=>' Yes ','n' => ' no') > )); > echo $this->Form->input('fiel
Making radio button labels clickable part deux...can someone pls explain why the example in book 1.3 isn't doing what it says...??
Hi... I posted a couple of days ago re making radio button labels clickable...but guess my question was too long...and reading it back, whilst accurate, it was pretty bloody boring too...sorry guys! (note after writing this...this too has become long - maybe not quite as boring (I hope), but left me bamboozled.) I've resorted to removing id from the input altogether as I think it's better to have nothing take place at all when clicking a label rather than the top radio button been selected irrespective of which label in the group is clicked. However...can someone please explain this to me. I'd still like to make radio labels clickable for the appropriate radio button...*sighs*. On this page: http://book.cakephp.org/view/1390/Automagic-Form-Elements , about a third of the way down (second para in 7.3.3.3), is an example of radio buttons with ---between--- text etc. Not really interested in the --betweens-- or --afters-- etc. Am VERY interested in the input ids and label fors however...as they seem to render as I want them to be... It looks like this: Form->input('field', array( 'before' => '--before--', 'after' => '--after--', 'between' => '--between---', 'separator' => '--separator--', 'options' => array('1', '2') ));?> And claims to output this (note the input->id and the label->for are the same, thus rendering the labels clickable): Output: --before-- 1 --separator-- 2 --between--- --after-- It doesn't do this for me. Firstly I had to add a type->radio, otherwise I get a select...which is ok, I added 'type' => 'radio'...but, and this is the frustrating bit...I see this being generated: --beforebetween--- Field 1 --separator-- 2 --after-- I'm in my members controller here...hence the MemberField rather than UserField, but that's all... See my input->ids and label->fors? All identical. Like peas in a pod. Like things that are indistinguishable from each other. Like twins. Like..like...like...pah! Any ideas?? If anyone can help, I'd be eternally grateful...well, for a bit anyway. Thanks in advance Dave Ok, so this has become long too...and it's about to get longer... After more trial and error, I've managed to get the labels working, with this format: echo $this->Form->input('field1', array( 'type' => 'radio', 'options' => array('Y'=>' Yes ','N' => ' No') )); which gives: Yes No (ie appends the N to the MemberField id. By no means ideal, but it works.) ...but this doesn't work (changed N to M) echo $this->Form->input('field2', array( 'type' => 'radio', 'options' => array('Y'=>' Yes ','M' => ' No') )); gives Yes No A I tried a few more examples... echo $this->Form->input('field3', array( 'legend' => false, 'type' => 'radio', 'options' => array('Y'=>' Yes ','A' => ' Ao') )); echo $this->Form->input('field4', array( 'legend' => false, 'type' => 'radio', 'options' => array('Y'=>' Yes ','n' => ' no') )); echo $this->Form->input('field5', array( 'legend' => false, 'type' => 'radio', 'options' => array('Y'=>' Yes ','m' => ' no') )); echo $this->Form->input('field6', array( 'legend' => false, 'type' => 'radio', 'options' => array('Y'=>' Yes ','a' => ' ao') )); AND WHAT HAPPENS? field3, 4 and 6 don't work, but, unbelievably field5 does. For what its worth, here's the html generated by the 4 statements above: Yes Ao Yes no Yes no Yes ao Baffled... What I want to do is send: ...a value for the input id, ...a value for the label 'for' (should be the same as the value for the input id above) ...a value for the value of the input (this could actually also be the same as the above) ...the text for the label in the $options array, and for cake to interpret these correctly. Is that possible These are the 4 items associated with a group of radio buttons that need to change for each radio button in the group (in normal circumstances). Everything else remains constant (tho there isn't much else anyway really...just the input type and name). Soo...by sending ('Y'=>'Yes','N' => 'No') I want to see: Yes No Surely that's reasonable isn't it??? Thanks Dave (just about hanging on to the furthest end of his tether...) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable?
Thanks Ryan, I did wonder that before posting my issue yesterday...I previously prefixed the 1 and 2 with 'reply', so the ids were reply1 and reply2, but to no avail... the code is below, the only change being the prefix of 'reply' in the array creation. Please note, I've reverted to the actual reply codes for male and female, 2520 and 2530 respectively, in place of 1 and 2, because I'm a little bemused by the id cake has now given the inputs (see a little lower), guessing they depend on the values in the $options array somehow? Where does the Pl of MemberGenderPl come from? And why?: $options = array(); $c = 0; while ($c < count($question['Reply'])) { $options['reply'.$question['Reply'][$c]['id']] = $question['Reply'] [$c]['value']; $c++; } echo $this->Form->input($question['Question']['name'], array( 'type' => 'radio', 'class' => 'list required', 'options' => $options )); For info, the $options array looks like this after it's created: Array ( [reply2520] => Male [reply2530] => Female ) This gives me: Male Female Obviously I can see that the $options array value reply2520 and reply2530 are now set as the value of the inputs. What I'm trying to achieve (with the real values of 2520 and 2530 instead of 1 and 2, and non-numeric ids) is this: Male Female Any further help would be great...I just want the ux to be correct, by the labels being clickable :/. This kind of thing is absolutely straightforward without using cake $this->Form->input(s), but then I lose the benefit of the save functionality etc...and I really wanna get to the bottom of this. Loving cake in all respects except this. Still think the issue is in the array - any advice anyone please?? I'm thinking should the array read something like: Array ( Array( [id] => reply2520, [value] => Male, [for] => reply2520), Array( [id] => reply2530, [value] => Female, [for] => reply2530) ) but tried various versions of this without getting there...pretty sure 'for' is not correct for instance...etc etc. Tried lots of things prior to posting here...and checked all documentation and other user's issues etc, but no definitive answer, Surely it can't be that tricky? Flummoxed... Thanks in advance... Dave On Nov 1, 3:22 am, Ryan Schmidt wrote: > On Oct 31, 2011, at 11:29, dave wrote: > > > What I want to achieve: > > > > name="data[Member][gender]"> > > Male > > > name="data[Member][gender]"> > > Female > > For the record, "1" and "2" are not valid HTML IDs. IDs must begin with a > letter. Some browsers enforce this. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable?
On Oct 31, 2011, at 11:29, dave wrote: > What I want to achieve: > > name="data[Member][gender]"> > Male > name="data[Member][gender]"> > Female For the record, "1" and "2" are not valid HTML IDs. IDs must begin with a letter. Some browsers enforce this. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Making radio button labels clickable?
More info: Just to make it clear, clicking either the Male or Female label currently sets the male radio button as selected. Also, I'm guessing my issue is probably in the options array... On Oct 31, 4:29 pm, dave wrote: > Got quite lengthy when writing it, but essentially my question below > is how to make radio button labels clickable. Pls read on... > > Quite new to Cakephp, and very pleased with results so far, but > perplexed by radio buttons. More accurately, adding labels with the > correct 'for' attribute to make them clickable alongside the correct > radio button (ie where the radio button 'id' and the label 'for' are > the same for each individual radio button). > > The form looks perfect, and indeed works perfectly if the user clicks > the actual radio button - but I feel the label should be clickable (am > I getting too anal here?) > > What I want to achieve: > > name="data[Member][gender]"> > Male > name="data[Member][gender]"> > Female > > What I'm getting: > > name="data[Member][gender]"> > Male > name="data[Member][gender]"> > Female > > (for info the controller is members_controller.php, using LoadModel to > incorporate the Question model) > > So my question is how do I get the correct values in 'id' on the input > and 'for' on the label. I know it should be simple, and have tried > many many variations of what's going into my options array > etc...any help would be much appreciated. > > Here's my code as it stands: > > $options = array(); > $c = 0; > while ($c < count($question['Reply'])) { > $options[$question['Reply'][$c]['id']] = $question['Reply'][$c] > ['value']; > $c++; > > } > > echo $this->Form->input($question['Question']['name'], array( > 'type' => 'radio', > 'class' => 'list required', > 'options' => $options > )); > > All taken from two tables, questions and replies - related via > question.id and reply.question_id > > Questions have many replies, so relationship in the Question model is: > > var $hasMany = array( > 'Reply' => array( > 'className' => 'Reply', > 'foreignKey' => 'question_id', > 'dependent'=> true > ) > ); > > The output from doing a find all of a certain question_id (in this > case gender) is: > ( > [0] => Array > ( > [Question] => Array > ( > [id] => 15 > [group_id] => 1 > [name] => gender > [text] => Gender? > [abbr_text] => Gender > ) > > [Reply] => Array > ( > [0] => Array > ( > [id] => 1 > [question_id] => 15 > [value] => Male > ) > > [1] => Array > ( > [id] => 2 > [question_id] => 15 > [value] => Female > ) > > ) > > ) > > Sorry for length, hope someone can help. Thanks...D -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Making radio button labels clickable?
Got quite lengthy when writing it, but essentially my question below is how to make radio button labels clickable. Pls read on... Quite new to Cakephp, and very pleased with results so far, but perplexed by radio buttons. More accurately, adding labels with the correct 'for' attribute to make them clickable alongside the correct radio button (ie where the radio button 'id' and the label 'for' are the same for each individual radio button). The form looks perfect, and indeed works perfectly if the user clicks the actual radio button - but I feel the label should be clickable (am I getting too anal here?) What I want to achieve: Male Female What I'm getting: Male Female (for info the controller is members_controller.php, using LoadModel to incorporate the Question model) So my question is how do I get the correct values in 'id' on the input and 'for' on the label. I know it should be simple, and have tried many many variations of what's going into my options array etc...any help would be much appreciated. Here's my code as it stands: $options = array(); $c = 0; while ($c < count($question['Reply'])) { $options[$question['Reply'][$c]['id']] = $question['Reply'][$c] ['value']; $c++; } echo $this->Form->input($question['Question']['name'], array( 'type' => 'radio', 'class' => 'list required', 'options' => $options )); All taken from two tables, questions and replies - related via question.id and reply.question_id Questions have many replies, so relationship in the Question model is: var $hasMany = array( 'Reply' => array( 'className' => 'Reply', 'foreignKey'=> 'question_id', 'dependent'=> true ) ); The output from doing a find all of a certain question_id (in this case gender) is: ( [0] => Array ( [Question] => Array ( [id] => 15 [group_id] => 1 [name] => gender [text] => Gender? [abbr_text] => Gender ) [Reply] => Array ( [0] => Array ( [id] => 1 [question_id] => 15 [value] => Male ) [1] => Array ( [id] => 2 [question_id] => 15 [value] => Female ) ) ) Sorry for length, hope someone can help. Thanks...D -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php