Re: cakephp 1.2 form helper,how to create() form without ugly inline css
The items within the form need to be contained in any block element to be validate as Strict. However, why is form helper inserting a SECOND fieldset and input (both are hidden): fieldset style=display:none;input type=hidden name=_method value=POST //fieldset On Apr 12, 10:41 pm, dzojntywole! [EMAIL PROTECTED] wrote: Ok guys... i got answer from jonathansnook on #cakephp, that extrafieldsetis needed only for strict doc type... for transitional it is ok to remove it( cake/libs/views/helpers/form.php ( line 212 on my rev 6637 to remove justfieldsetor.. line 187 to remove all thathiddenthing.. i checked w3 validation and its fine, your base code looks much prettier than.. so if you are not going to use strict.. go for it. Bart On Apr 8, 10:43 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi again, I just read your post, I removed manually thatfieldset thing( I removed whole but what I dislike there was that inline css.. by the rule I keep my css and javascript in external files) I created simpleform(below) and I checked in w3validator.. I got This Page Is Valid XHTML 1.0 Transitional! that makes me happy enough to keep it like that.. could you give me a source of it's invalid to have any input elements within aformelement that aren't also enclosed by a block-level element ? btw.. I agree that this inline css makes life much easier in development stage: scaffolding etc.. but for final product in my opinion view(html) is as much important as its server side.. so adding option informhelpercreate() to remove extra markup would be a good idea. Bart !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleUntitled Document/title /head body div class=login h2Login/h2 formid=UserLoginForm method=post action=/otherwise/6609/ users/logininput type=hidden name=_method value=POST / div class=inputinput name=data[User][username] type=text maxlength=20 value= id=UserUsername //div div class=inputinput type=password name=data[User] [password] value= id=UserPassword //div div class=submitinput type=submit value=Login //div /form /div /body /html .. On Apr 8, 1:58 am, Stephen Orr [EMAIL PROTECTED] wrote: The CSS is there because of a ticket I posted - in XHTML it's invalid to have any input elements within aformelement that aren't also enclosed by a block-level element (so, afieldset, a paragraph, a div). The inline CSS is purely there to allow you to have valid XHTML and not break your layout with an additionalfieldsetinto the bargain. Steve On Apr 7, 9:30 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Why is it bothering you? You can't see it, the user can't see it..which means - by all means - that it isn't really there ;-) On Apr 5, 10:10 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi everybody, I am trying to useformhelperto create aformin my view: ?php echo $form-create() ? the result is: formid=UserAddForm method=post action=/otherwise/6609/users/ addfieldsetstyle=display:none;input type=hidden name=_method value=POST //fieldset is there a way to remove that inline style other than editinghelper files? i do not want to reinvent the wheel if the option like that already exist... i tried to google it, asked on #cakephp looked on manual.. api.. still confused hope to get hint, thanks B.W --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form helper,how to create() form without ugly inline css
Ok guys... i got answer from jonathansnook on #cakephp, that extra fieldset is needed only for strict doc type... for transitional it is ok to remove it( cake/libs/views/helpers/ form.php ( line 212 on my rev 6637 to remove just fieldset or.. line 187 to remove all that hidden thing.. i checked w3 validation and its fine, your base code looks much prettier than.. so if you are not going to use strict.. go for it. Bart On Apr 8, 10:43 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi again, I just read your post, I removed manually that fieldset thing( I removed whole but what I dislike there was that inline css.. by the rule I keep my css and javascript in external files) I created simple form(below) and I checked in w3validator.. I got This Page Is Valid XHTML 1.0 Transitional! that makes me happy enough to keep it like that.. could you give me a source of it's invalid to have any input elements within a form element that aren't also enclosed by a block-level element ? btw.. I agree that this inline css makes life much easier in development stage: scaffolding etc.. but for final product in my opinion view(html) is as much important as its server side.. so adding option in form helper create() to remove extra markup would be a good idea. Bart !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleUntitled Document/title /head body div class=login h2Login/h2 form id=UserLoginForm method=post action=/otherwise/6609/ users/logininput type=hidden name=_method value=POST / div class=inputinput name=data[User][username] type=text maxlength=20 value= id=UserUsername //div div class=inputinput type=password name=data[User] [password] value= id=UserPassword //div div class=submitinput type=submit value=Login //div /form /div /body /html .. On Apr 8, 1:58 am, Stephen Orr [EMAIL PROTECTED] wrote: The CSS is there because of a ticket I posted - in XHTML it's invalid to have any input elements within a form element that aren't also enclosed by a block-level element (so, a fieldset, a paragraph, a div). The inline CSS is purely there to allow you to have valid XHTML and not break your layout with an additional fieldset into the bargain. Steve On Apr 7, 9:30 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Why is it bothering you? You can't see it, the user can't see it..which means - by all means - that it isn't really there ;-) On Apr 5, 10:10 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi everybody, I am trying to use form helper to create a form in my view: ?php echo $form-create() ? the result is: form id=UserAddForm method=post action=/otherwise/6609/users/ addfieldset style=display:none;input type=hidden name=_method value=POST //fieldset is there a way to remove that inline style other than editing helper files? i do not want to reinvent the wheel if the option like that already exist... i tried to google it, asked on #cakephp looked on manual.. api.. still confused hope to get hint, thanks B.W --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form helper,how to create() form without ugly inline css
Why is it bothering you? You can't see it, the user can't see it..which means - by all means - that it isn't really there ;-) On Apr 5, 10:10 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi everybody, I am trying to use form helper to create a form in my view: ?php echo $form-create() ? the result is: form id=UserAddForm method=post action=/otherwise/6609/users/ addfieldset style=display:none;input type=hidden name=_method value=POST //fieldset is there a way to remove that inline style other than editing helper files? i do not want to reinvent the wheel if the option like that already exist... i tried to google it, asked on #cakephp looked on manual.. api.. still confused hope to get hint, thanks B.W --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form helper,how to create() form without ugly inline css
The CSS is there because of a ticket I posted - in XHTML it's invalid to have any input elements within a form element that aren't also enclosed by a block-level element (so, a fieldset, a paragraph, a div). The inline CSS is purely there to allow you to have valid XHTML and not break your layout with an additional fieldset into the bargain. Steve On Apr 7, 9:30 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Why is it bothering you? You can't see it, the user can't see it..which means - by all means - that it isn't really there ;-) On Apr 5, 10:10 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi everybody, I am trying to use form helper to create a form in my view: ?php echo $form-create() ? the result is: form id=UserAddForm method=post action=/otherwise/6609/users/ addfieldset style=display:none;input type=hidden name=_method value=POST //fieldset is there a way to remove that inline style other than editing helper files? i do not want to reinvent the wheel if the option like that already exist... i tried to google it, asked on #cakephp looked on manual.. api.. still confused hope to get hint, thanks B.W --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form helper,how to create() form without ugly inline css
Hi again, I just read your post, I removed manually that fieldset thing( I removed whole but what I dislike there was that inline css.. by the rule I keep my css and javascript in external files) I created simple form(below) and I checked in w3validator.. I got This Page Is Valid XHTML 1.0 Transitional! that makes me happy enough to keep it like that.. could you give me a source of it's invalid to have any input elements within a form element that aren't also enclosed by a block-level element ? btw.. I agree that this inline css makes life much easier in development stage: scaffolding etc.. but for final product in my opinion view(html) is as much important as its server side.. so adding option in form helper create() to remove extra markup would be a good idea. Bart !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleUntitled Document/title /head body div class=login h2Login/h2 form id=UserLoginForm method=post action=/otherwise/6609/ users/logininput type=hidden name=_method value=POST / div class=inputinput name=data[User][username] type=text maxlength=20 value= id=UserUsername //div div class=inputinput type=password name=data[User] [password] value= id=UserPassword //div div class=submitinput type=submit value=Login //div /form /div /body /html .. On Apr 8, 1:58 am, Stephen Orr [EMAIL PROTECTED] wrote: The CSS is there because of a ticket I posted - in XHTML it's invalid to have any input elements within a form element that aren't also enclosed by a block-level element (so, a fieldset, a paragraph, a div). The inline CSS is purely there to allow you to have valid XHTML and not break your layout with an additional fieldset into the bargain. Steve On Apr 7, 9:30 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Why is it bothering you? You can't see it, the user can't see it..which means - by all means - that it isn't really there ;-) On Apr 5, 10:10 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi everybody, I am trying to use form helper to create a form in my view: ?php echo $form-create() ? the result is: form id=UserAddForm method=post action=/otherwise/6609/users/ addfieldset style=display:none;input type=hidden name=_method value=POST //fieldset is there a way to remove that inline style other than editing helper files? i do not want to reinvent the wheel if the option like that already exist... i tried to google it, asked on #cakephp looked on manual.. api.. still confused hope to get hint, thanks B.W --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form
Thanks for the answer, but I'd love a little more guidance myself. Can you answer OP's Q1, which is the difference between $ajax-form and $ajax-submit? Also, please explain the $this-render('view','ajax'); line of code? There is nothing in the API (http://api.cakephp.org/1.2/ class_controller.html#90046e6b62c91452a987c9573372c2ac) about a special 'ajax' value as a layout option. What does this do? Does it render no layout if the request was ajax? How does the action know whether an incoming request is coming from an Ajax source or not? On Feb 23, 4:54 pm, b logica [EMAIL PROTECTED] wrote: Try this to close your controller action: $this-render('VIEW', 'ajax'); where VIEW is the name of your view. (or element?) On Sat, Feb 23, 2008 at 12:30 PM, brammeleman [EMAIL PROTECTED] wrote: I'm trying to create a simpleAjaxbasedform. These are the steps I've taken along with the questions that came up: I've managed to get the forms' content into a div element. Done by creating an 'ajax' instead of an 'html' link. When I submit theform, I get redirected back to the index view showing the modified or added record. All fine! But, when theformvalidation fails, I get redirected to theform directly rendered into the layout (instead of in the div element). To solve this problem, I've replaced the $form-create helper call by the $ajax-formhelper call in theformview. Telling the $ajax-form function to update the div element. Q1) what's the difference in using $ajax-formand $ajax-submit? should one of them be used exclusively? or do they need to be used in a pair (like $form-create and $form-end)? Now it works nice when theformvalidation fails. But when the submitted data validates, the redirected (index) page gets rendered in the div. The funny thing is that somehow the requesthanler doesn't know it's anajaxrequest. It renders the content in the default layout. I'm obviously missing the point somewhere Q2) how can you make sure thatformstays in the div, but when it validates you get a non-ajaxredirect? Thanks for your help, Bram ps: someone else apparently posted a similar question in the bin: http://bin.cakephp.org/saved/521 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form
Try this to close your controller action: $this-render('VIEW', 'ajax'); where VIEW is the name of your view. (or element?) On Sat, Feb 23, 2008 at 12:30 PM, brammeleman [EMAIL PROTECTED] wrote: I'm trying to create a simple Ajax based form. These are the steps I've taken along with the questions that came up: I've managed to get the forms' content into a div element. Done by creating an 'ajax' instead of an 'html' link. When I submit the form, I get redirected back to the index view showing the modified or added record. All fine! But, when the form validation fails, I get redirected to the form directly rendered into the layout (instead of in the div element). To solve this problem, I've replaced the $form-create helper call by the $ajax-form helper call in the form view. Telling the $ajax-form function to update the div element. Q1) what's the difference in using $ajax-form and $ajax-submit? should one of them be used exclusively? or do they need to be used in a pair (like $form-create and $form-end)? Now it works nice when the form validation fails. But when the submitted data validates, the redirected (index) page gets rendered in the div. The funny thing is that somehow the requesthanler doesn't know it's an ajax request. It renders the content in the default layout. I'm obviously missing the point somewhere Q2) how can you make sure that form stays in the div, but when it validates you get a non-ajax redirect? Thanks for your help, Bram ps: someone else apparently posted a similar question in the bin: http://bin.cakephp.org/saved/521 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP 1.2 - Form select
I could do with finding a good tutorial too. I found the samples at http://www.donutczar.com/cake1point2/donuts/form_helper They are a good start. On Oct 14, 4:49 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Its okay now. I just add 1 null value to the attribute of select before it was... echo $form-select(gender, array( = - Select One -, M = Male, F = Female), null, false); after.. echo $form-select(gender, array( = - Select One -, M = Male, F = Female), null, null, false); Can't seem to find a good tutorial for CakePHP 1.2, do you have any recommendation? thanks, Wendell --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP 1.2 - Form select
You'll need to provide more information about what you're doing and what is happening. Many of us are very successfully using select boxes in our forms with Cake 1.2, so it seems to be something specific to your environment or your code. Wayne On 10/13/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm trying to put up a registration form for my website but unfortunately I encountered this problem, I can't retain the form- select value during validation. How can I retain the value being selected on my $form-select while on the process of validation. I've been trying to search for answers using google but I havent found one. I'm using CakePHP 1.2alpha. Hope someone could help me. Thank you very much. Regards, Wendell --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP 1.2 - Form select
Its okay now. I just add 1 null value to the attribute of select before it was... echo $form-select(gender, array( = - Select One -, M = Male, F = Female), null, false); after.. echo $form-select(gender, array( = - Select One -, M = Male, F = Female), null, null, false); Can't seem to find a good tutorial for CakePHP 1.2, do you have any recommendation? thanks, Wendell --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---