Re: Variable state through multiple Ajax requests (ModalBox) including forms

2009-01-13 Thread WebbedIT
of actions within a single modal window (Index, Add, Edit, Delete). In my opinion I have also implemented ModalBox much better by adjusting how links and forms are submitted within the window so that ModalBox does the hard work of displaying the spinner whilst the content is updated

Re: Variable state through multiple Ajax requests (ModalBox) including forms

2009-01-13 Thread Chad Casselman
, Delete). In my opinion I have also implemented ModalBox much better by adjusting how links and forms are submitted within the window so that ModalBox does the hard work of displaying the spinner whilst the content is updated and then resizes the window to accommodate the new content (namely doing

Re: Variable state through multiple Ajax requests (ModalBox) including forms

2009-01-13 Thread WebbedIT
Would love to share what I have learnt, but would prefer to do so after I have a fully working example. I will also provide a demo of it in use the way I am using it as it is quite neat and should be something most people could use. Also I can get some feedback on it's positives and negatives

Multiple forms per page, field IDs need to be unique

2009-01-12 Thread Chris Hawes
Hello, I'm currently working on an e-commerce application. On the product pages, I am generating a form to add products to the cart. As such, each page can contain several forms. I've created a helper for my application which contains: product display; add to cart form generation; menu

Re: Multiple forms per page, field IDs need to be unique

2009-01-12 Thread Rogelio Nodal
I'm new to CakePHP(day of reading documentation is pretty much my experience) but If it was me doing it I would instead of using forms I would just add links in the form /produtcs/addtocart/45 or /products/addtocart/VeryNiceProduct and then use the flash function to redirect back to the products

Re: Multiple forms per page, field IDs need to be unique

2009-01-12 Thread brian
experience) but If it was me doing it I would instead of using forms I would just add links in the form /produtcs/addtocart/45 or /products/addtocart/VeryNiceProduct and then use the flash function to redirect back to the products page noting which products are added to the cart. Like I said before

Re: Multiple forms per page, field IDs need to be unique

2009-01-12 Thread mark_story
specify the id attribute? -Mark On Jan 12, 6:05 am, Chris Hawes m...@chrishawes.net wrote: Hello, I'm currently working on an e-commerce application. On the product pages, I am generating a form to add products to the cart. As such, each page can contain several forms. I've created

set checkboxes on multiple forms

2009-01-02 Thread brian
I have an admin_index page for a model that requires a listing for each row, which includes a *separate* form with a couple of checkboxes. The controller action is: public function admin_index() { $this-data = $this-paginate(); } Now, in the view, I cannot figure out how to get the

Re: set checkboxes on multiple forms

2009-01-02 Thread brian
On Fri, Jan 2, 2009 at 11:53 PM, brian bally.z...@gmail.com wrote: I have an admin_index page for a model that requires a listing for each row, which includes a *separate* form with a couple of checkboxes. The controller action is: public function admin_index() { $this-data =

Security component and AJAX forms

2009-01-01 Thread archF6
use the blackhole callback to circumvent the issue by determining controller name and action, but would prefer to keep security component enabled for these forms if possible. The reason for such an approach is this... Basically a blog with comments, but product developers want people to write

How to make forms in cakephp

2008-12-23 Thread mona
I m new to cake php i want to make form in cakephp and i make the following things class User extends AppModel { var $name = 'User'; var $validate = array( 'name'=array('rule'='notEmpty'), 'email'=array('rule'='email'), 'password'=array(

Re: How to make forms in cakephp

2008-12-23 Thread eMarcus
Hi Mona, Well, it would help if you could specify the error a bit more. The form need to be called 'app/views/users/add.ctp'. I don't know if you can make echo $form-inputs(array('name', 'email', 'password')); I would rather do: echo $form-input('User.name'); echo

Re: cake 1.2 forms: date fields left empty = null in database?

2008-12-18 Thread Sebastian Göttschkes
Hi, thanks for your reply. The data field was set to null before. If I update a dataset and assigning the null value to a the birthday field (SET birthday=null) it works fine. So I added the following code to my controller: if(empty($this-data['Employee']['birthday']))

Re: cake 1.2 forms: date fields left empty = null in database?

2008-12-17 Thread Adriano Varoli Piazza
On 16 dic, 11:44, Sebastian Göttschkes sebastian.goettsch...@mpx- e.de wrote: Additionally, if I add a valid birthday, it is saved correctly. When editing the employee, I would like to get the birthday viewed in the format dd.mm.. How can I tell cake to view the birthday like this? Ok,

Re: cake 1.2 forms: date fields left empty = null in database?

2008-12-16 Thread Alexandru Ciobanu
Sebastian Göttschkes wrote: Hi, i got the following problem using cakePHP 1.2 RC3: My Model 'Employee' has a attribute called 'birthday' (datatype: DATE). In the add-view, I have the following code: ?= $form-input('birthday',array('type'='text'));? If i left this field blank when adding

AW: cake 1.2 forms: date fields left empty = null in database?

2008-12-16 Thread Liebermann, Anja Carolin
to validate! Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] Im Auftrag von Sebastian Göttschkes Gesendet: Dienstag, 16. Dezember 2008 14:45 An: CakePHP Betreff: cake 1.2 forms: date fields left empty = null in database? Hi, i got

Re: cake 1.2 forms: date fields left empty = null in database?

2008-12-16 Thread Adriano Varoli Piazza
I am in the process of editing my views to get a similar effect. If you can wait a couple hours, I'll be back with an explanation. But, to whet your appetite: controlling for '-00-00' is not that different from controlling for null, seems to me. '-00-00' is the 'null value' for a date

cake 1.2 forms: date fields left empty = null in database?

2008-12-16 Thread Sebastian Göttschkes
Hi, i got the following problem using cakePHP 1.2 RC3: My Model 'Employee' has a attribute called 'birthday' (datatype: DATE). In the add-view, I have the following code: ?= $form-input('birthday',array('type'='text'));? If i left this field blank when adding an employee, this employee has the

Prepopulating forms via the URL

2008-12-15 Thread acoustic_overdrive
I just thought of a little function that I wanted to get some feedback on. It's a way to pre-populate a form when adding new records, using the URL only and no controller-specific controller logic. In AppController::beforeRender : if(isset($_REQUEST['populate'])) { if(empty($this-data))

Re: Prepopulating forms via the URL

2008-12-15 Thread Alexandru Ciobanu
acoustic_overdrive wrote: I just thought of a little function that I wanted to get some feedback on. It's a way to pre-populate a form when adding new records, using the URL only and no controller-specific controller logic. In AppController::beforeRender : if(isset($_REQUEST['populate']))

Re: Prepopulating forms via the URL

2008-12-15 Thread brian
On Mon, Dec 15, 2008 at 1:18 PM, acoustic_overdrive jamierm...@googlemail.com wrote: I just thought of a little function that I wanted to get some feedback on. It's a way to pre-populate a form when adding new records, using the URL only and no controller-specific controller logic. In

Re: Prepopulating forms via the URL

2008-12-15 Thread acoustic_overdrive
Hi, thanks both for your replies. @Alexandru: Unfortunately that's not flexible enough for me, because depending on where I'm coming from I may or may not want to pre- populate a field. @brian: I usually do it something like /project_images/add/project_id: 3 but that means I have to write logic

Re: Managing empty data in forms with associations

2008-12-09 Thread majna
Maybe you can use $this-data['Users'] = Set::filter($this-data['Users']); On Dec 8, 8:52 pm, variaas [EMAIL PROTECTED] wrote: Does CakePHP have a function to clear out empty datarows before saving? Right now I manually parse the array to see if there is an empty array and unset it. So

Re: adding info from forms to more then one table

2008-12-09 Thread webscriptz
I was thinking like this: function add() { if (!empty($this-data)) { $this-Timespan-create(); if ($this-Timespan-save($this-data)) { $this-data['Timespan']['saldo'] = $this-data['Timespan'] ['saldo']

Re: adding info from forms to more then one table

2008-12-09 Thread webscriptz
I'm going to give a better description of the problem When I add a record the data will be stored in the records table of my database what I want to do is: When my records is saved the system should do something like this, when it's saved call the timespan that is selected, load the saldo

Managing empty data in forms with associations

2008-12-08 Thread variaas
Does CakePHP have a function to clear out empty datarows before saving? Right now I manually parse the array to see if there is an empty array and unset it. So given this array: [data] = [0] = [name] = 'alice' [1] = [name] = 'bob' [2] = [name] = '' I would unset

Re: correct way to create multiple text forms in a table

2008-12-03 Thread Todd M
the findAll functions. This would produce a 2x2 table. The part that I don't quite understand is how to create the forms with knowledge of the X's Y's ID. so I know how to properly save it to the Z model, using a saveAll. I have only had experience with doing this one entry at a time. Thanks

Re: adding info from forms to more then one table

2008-12-02 Thread webscriptz
normally i would read it out with php, put them in vars and addition the values and resave them. On Dec 2, 10:49 am, webscriptz [EMAIL PROTECTED] wrote: Sorry for that, I have a model Records and Timespans. DEBET and CREDIT have to be inserted in the records table but also in the Timespans

Re: adding info from forms to more then one table

2008-12-02 Thread webscriptz
Sorry for that, I have a model Records and Timespans. DEBET and CREDIT have to be inserted in the records table but also in the Timespans table in DEBET and CREDIT The first is not a problem but the second is. IT has to be additioned not just replaced by the latest. function add() {

Re: adding info from forms to more then one table

2008-12-02 Thread Rob
I would suggest looking at saveAll to do the save part, then to do your addition you just need to make sure it's in the data. That said, here's the way I handle adding a related record as shown in your add() above: function add() { if (!empty($this-data)) {

correct way to create multiple text forms in a table

2008-12-02 Thread Todd M
is to have one submit and the controller will will call a model-saveall function. However of the text box forms has a id associated to the top row and leftmost column. In other words the form is saving to a model that has belongsTo association with the top row and left. Is there something that I'm missing

Re: correct way to create multiple text forms in a table

2008-12-02 Thread brian
Could you query again, but without all the table display stuff? You have 4 text boxes in a view and ... what? What's the model name, and what models is it associated to (and how)? Or is it 4 separate forms? 5? On Wed, Dec 3, 2008 at 12:27 AM, Todd M [EMAIL PROTECTED] wrote: I'm creating

adding info from forms to more then one table

2008-12-01 Thread webscriptz
I'm making a register and I have a small problem, I want two numbers to be additioned (+) with the numbers already in an other table, unfortunantly I don't know how to do this. i have a Record with debet and credit and i want to addition them to debet and credit in timespans. but they got

Re: adding info from forms to more then one table

2008-12-01 Thread Rob
So just a suggestion for future questions, describe the tables and their relationship in your question a little next time. Assuming you have a Records model and a Timespans model that are related to each other, and the relationships are described in the models for those two entities ... So, for

Re: Working with forms for CMS

2008-11-20 Thread Jon Bennett
Hi Flipflops, Nice one, sorry for delayed response but been sidetracked by another project. class FormsController extends AppController { var $name = 'Forms'; /** * a generic method to handle the submited forms * looks up a schema / and validation rules

Re: Working with forms for CMS

2008-11-19 Thread Flipflops
Hi Jon, Dardo I guess it depends how hacky you want to be. You could have two models one that manages the form builder and another which is really just a shell that would validate the actual forms when you submit them. Off the top of my head I guess you could do something like this (not tried

need help with forms and ajax

2008-11-19 Thread mmm
hi group, i'm missing something really simple and i need your help, i have a simple form in my view, when a user presses submit button i want to send form data to controller( or view) and get the result back in the ajax callback, updating one singe div on the view. how can actually do that?

Re: need help with forms and ajax

2008-11-19 Thread mmm
already found a solution to it! thanks anyway! On 19 Nov., 13:15, mmm [EMAIL PROTECTED] wrote: hi group, i'm missing something really simple and i need your help, i have a simple form in my view, when a user presses submit button i want to send form data to controller( or view) and get the

Re: Working with forms for CMS

2008-11-18 Thread Jon Bennett
Hi bakers, Got a theory/approach question, hoping someone's been down this route already. A lot of my projects are CMS'd sites. This largely means a few models: * Page * Article * Documents (files, images, media etc) Often I have to work with forms, contact forms, email sign ups

Re: Working with forms for CMS

2008-11-18 Thread Dardo Sordi Bogado
Often I have to work with forms, contact forms, email sign ups etc that are then embedded in each page, and I'd really like to use the cake validation and auto magic, whilst avoiding manually creating a model for each form. What is wrong with creating a Model for handling the data of your

Re: Working with forms for CMS

2008-11-18 Thread Dardo Sordi Bogado
What about adding 2 fields to Forms: Forms - id - name - schema (serialised obj) - validation_rules (serialised obj) And then passing the values of each to the Form model in beforeValidate? It seems pretty strightforward to do, why don't give it a try and then tell us how it went

Re: Working with forms for CMS

2008-11-18 Thread Jon Bennett
It seems pretty strightforward to do, why don't give it a try and then tell us how it went? Am just thinking things through a little further. I was thinking about how I would set the _schema and validate values. I had thought about calling a method in afterFind, but they aren't run for

Re: Working with forms for CMS

2008-11-18 Thread Flipflops
Hi Passing the schema and validation rules seems like a good idea - I'm guessing your are thinking you could couple it with some kind of wizard / interface so you build your forms within the CMS... could be a really goood feature but at the end of the day it boils down to how long the initial

Re: Working with forms for CMS

2008-11-18 Thread Jon Bennett
Hi Flip flops, Passing the schema and validation rules seems like a good idea - I'm guessing your are thinking you could couple it with some kind of wizard / interface so you build your forms within the CMS... could be a really goood feature but at the end of the day it boils down to how

Re: Working with forms for CMS

2008-11-18 Thread Dardo Sordi Bogado
so did I - but I've just realised that my 'EmailForm' model would have it's own schema, at least: Why don't use two models: one for handling the validation of the dynamic forms and one for storing the metadata in the DB. Then in the dynamics forms, you can override schema() and probably

Working with forms for CMS

2008-11-17 Thread Jon Bennett
Hi folks, Got a theory/approach question, hoping someone's been down this route already. A lot of my projects are CMS'd sites. This largely means a few models: * Page * Article * Documents (files, images, media etc) Often I have to work with forms, contact forms, email sign ups etc

Handy trick for forms that down offer all fields from model.

2008-11-13 Thread Josey
As a relatively new baker and programmer, for that matter, I ran into a problem earlier this week. I was creating a form for users to edit their information however, not all fields were present in this form for the general member but those fields happened to be required fields. In the model

Re: Handy trick for forms that down offer all fields from model.

2008-11-13 Thread teknoid
I assume you had 'required'=true as part of the validation rules. Seems like, yet another, misunderstanding :) http://teknoid.wordpress.com/2008/11/04/requiredtrue-the-source-of-major-confusion/ On Nov 13, 9:02 am, Josey [EMAIL PROTECTED] wrote: As a relatively new baker and programmer, for

Re: Handy trick for forms that down offer all fields from model.

2008-11-13 Thread teknoid
'requied'=true, is rarely necessary. You are probably more interested in the 'notEmpty' rule. If you read the manual (ans possibly my post above), you'll see why 'required' doesn't exactly mean what you'd expect. Using the default value of false, will help you to avoid any trickery (unless you

Accessibility and forms

2008-11-09 Thread イタリア人
Hello all, although putting tags in the right order does not make an accessible website, I was wondering if anyone is really looking at priority AAA for accessible websites and updated the form helper... Anyone ? Julien --~--~-~--~~~---~--~~ You received this

Re: validation conflicts: two forms, one model, one page

2008-10-27 Thread Christian Leskowsky
' form. How can I contain the error message to the appropriate form? -- View this message in context: http://www.nabble.com/validation-conflicts%3A-two-forms%2C-one-model%2C-one-page-tp20141502p20141502.html Sent from the CakePHP mailing list archive at Nabble.com

Re: validation conflicts: two forms, one model, one page

2008-10-27 Thread RyOnLife
It's a workaround, but did the trick: $('#FormName .error-message').hide() -- View this message in context: http://n2.nabble.com/validation-conflicts%3A-two-forms%2C-one-model%2C-one-page-tp1370230p1382883.html Sent from the CakePHP mailing list archive at Nabble.com

validation conflicts: two forms, one model, one page

2008-10-23 Thread RyOnLife
the error message to the appropriate form? -- View this message in context: http://www.nabble.com/validation-conflicts%3A-two-forms%2C-one-model%2C-one-page-tp20141502p20141502.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You

Re: Auth component and ajax forms

2008-10-03 Thread CG
you need. HTH, CG On Oct 2, 4:17 pm, RobertoSDN [EMAIL PROTECTED] wrote: Hello, i am using ajax forms and i have a problem with the Auth component that works fine with the login action but not with others actions because only the login action has the bahavior to render a element to handle

Auth component and ajax forms

2008-10-02 Thread RobertoSDN
Hello, i am using ajax forms and i have a problem with the Auth component that works fine with the login action but not with others actions because only the login action has the bahavior to render a element to handle errors like bellow: if ($loginAction == $url) { ...code } else

CakePHP 1.1, AJAX and forms not doing anything.

2008-09-30 Thread aka
Hi! I have a controller, which fetches other controllers data through requestAction(). The first element contains a form in which there is an $ajax- submit(...); the problem here is that the form does nothing. The form doesen't even send XHR request. However, the $ajax-link's works just fine

Re: CakePHP 1.1, AJAX and forms not doing anything.

2008-09-30 Thread clemos
Hi You should at least give the code from your view, so that we can figure out what's going on. Also, english is not my mother language, and I don't understand this sentence : However, the $ajax-link's works just fine and when I click one of the links, resultin an update to the that element

Re: CakePHP 1.1, AJAX and forms not doing anything.

2008-09-30 Thread aka
Yes Sorry clemos, was alittle tired on this afternoon. Here is the question completely rewritten :) 1. Download the latest stable release of CakePHP (1.1.19.6305) 1.1 Set it up and running. 2. Download the prototype.js library and copy it to your fresh cake installation js -folder. 3. Lets

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread David C. Zentgraf
Are you looking for this? http://book.cakephp.org/view/410/Validating-Data-from-the-Controller On 18 Sep 2008, at 13:51, 703designs wrote: How can I check if the data is valid before trying to send the mail out? Validation errors are falling into the email failed condition, and validation

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread 703designs
I saw that last night before posting, and wrapping the send sequence in this conditional didn't work: I got funny preg_match errors (also noted here: http://ryan.ifupdown.com/2008/08/24/delimiter-must-not-be-alphanumeric-or-backslash-corecakelibsmodelmodelphp-line-2202/ , although his fix didn't

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread David C. Zentgraf
On 18 Sep 2008, at 21:50, 703designs wrote: I got funny preg_match errors Show us your $validate rules then or go through them with a fine comb. $this-Contact-set('$this-data); I hope this is not copypasted as it's invalid PHP. This controller's 'add' method just sends out emails and

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread 703designs
Right, that was a typo, not a paste. I think that you'll be able to better help me if you understand how I've designed my contact form: Model: Contact[name, email, city, subject, message, and a couple others] Model['validate']: Name, email, and message have 'required' = true Views: index (just

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread 703designs
Note that each ['validate'] key also has a normal ['message'] defined, saying that the field in question is required. On Sep 18, 9:29 am, David C. Zentgraf [EMAIL PROTECTED] wrote: On 18 Sep 2008, at 21:50, 703designs wrote: I got funny preg_match errors Show us your $validate rules then

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread David C. Zentgraf
I'm not 100% sure, but I think older versions of Cake required you to specify a rule. If you're only interested in the 'required' field, specify a rule that'll always validate, like '/.*/' . What version of Cake are you using? Structure your app the way you see fit. It's not good form to

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread 703designs
So a rendered view will automatically receive validation messages? In which variable? If I need to set a var, what should my target be ($this-set('errors', /* what here? */))? I tried substituting a minLength 1 rule yesterday and if it worked, I would not have changed it, although I can't with

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread David C. Zentgraf
On 18 Sep 2008, at 23:53, 703designs wrote: So a rendered view will automatically receive validation messages? In which variable? Yes. When a model is validated in the controller, invalid fields will be noted in a variable. Don't know of the top of my head in which one, do a debug($this)

Re: Forms not validating while using EmailComponent?

2008-09-18 Thread Brett Wilton
pr($this-validationErrors) in your view will show you the errors. --- Brett Wilton http://wiltonsoftware.com On Fri, Sep 19, 2008 at 12:31 PM, David C. Zentgraf [EMAIL PROTECTED] wrote: On 18 Sep 2008, at 23:53, 703designs wrote: So a rendered view will automatically receive validation

Forms not validating while using EmailComponent?

2008-09-17 Thread 703designs
How can I check if the data is valid before trying to send the mail out? Validation errors are falling into the email failed condition, and validation errors aren't reported to the user. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Edit forms in Internet Explorer

2008-09-13 Thread chicklin
Wow, that's pretty obscure. Yes, I'm using mod_auth_sspi. It was so easy to set up, I hate to change to LDAP, but it looks like that's going to be necessary. Thanks for the suggestion, I'll give it a try. On Sep 12, 6:32 pm, Niko [EMAIL PROTECTED] wrote: I was having the exact same problem

upgrading to 1.2 and non-ascii characters in forms

2008-09-13 Thread igor
Hello, I'm in a middle of migrating a project from cake 1.1 to 1.2. I've got most pages to display, but I ran into one problem with forms. Source code in a view goes like this: $miesiace=array('Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik

Re: Edit forms in Internet Explorer

2008-09-12 Thread Niko
I was having the exact same problem until I disable the mod_auth_sspi module. I then replaced it with mod_authnz_ldap and everything works fine. Maybe you can check something at a module level. When I set a proxy between the web server and IE I found out that when it got stuck all the server got

Edit forms in Internet Explorer

2008-09-09 Thread chicklin
Hello, using cake_1.2.0.7296-rc2 under Apache/PHP5/Windows I'm having a problem where when I submit a form to edit a database entity, the controller sometimes does not recognize $this-data as being set and sends me back to the orignal edit form. The weird thing is, that if I try it a couple

Re: Edit forms in Internet Explorer

2008-09-09 Thread scs
I suggest posting the view and controller. The first thing I would look at is there any JavaScript that IE is having issue with. On Sep 9, 10:46 am, chicklin [EMAIL PROTECTED] wrote: Hello, using cake_1.2.0.7296-rc2 under Apache/PHP5/Windows I'm having a problem where when I submit a form to

Re: Edit forms in Internet Explorer

2008-09-09 Thread chicklin
There is no Javascript in the page whatsoever. If you read through the controller logic, the only way that the form will return to itself without doing anything is if $this-data is not set (i.e. empty($this- data)). Here is the controller: ?php class DomainsController extends AppController {

Multiple AJAX forms per page from the same source

2008-09-07 Thread Warringer
I have a database driven galery. CREATE TABLE EXISTS `galeries` ( `id` int(11) NOT NULL auto_increment, `year` year(4) NOT NULL, `titel` tinytext NOT NULL, `subtitle` tinytext NOT NULL, `folder` tinytext NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE EXISTS `images` ( `id` int(11)

Re: Handling HTML special chars from user generated content ( e.g. forms)

2008-08-29 Thread Mark (Germany)
i dont see the reason for changing them to HTML code anyway - as with utf8 they can all be handled and displayed as they originally are. On 28 Aug., 17:46, worthy [EMAIL PROTECTED] wrote: You saved my day. :D I was messing with this problem the whole day and never thought it would be that

Handling HTML special chars from user generated content ( e.g. forms)

2008-08-28 Thread worthy
Hi bakers, as by the last week i am really getting into CakePHP and enjoy the easeness of the creation process. But i have one simple problem. In every form of the project where users can input data, they can for example input ( ä,ö,ü, é... and special chars like %§%/ or whatever) So i want to

Re: Handling HTML special chars from user generated content ( e.g. forms)

2008-08-28 Thread worthy
Hi bakers again :), i managed to do it another way. These two function provided below are the key for it. As you can see I placed them inside of the app_controller.php class AppController extends Controller { function htmlchars($data) { if (empty($data)) {

Re: Handling HTML special chars from user generated content ( e.g. forms)

2008-08-28 Thread worthy
Another explaining example for the edit form: http://localhost/regions/edit/15 data['Regions']['id']=15 data['Regions']['name']='Test auml;' Now when cakephp fills the form with this data the value of the field changes from 'Test auml;' to 'Test amp;auml;' And so the field shows 'Test auml;

Re: Forms not associated to models - alternative to the Form core helper?

2008-08-27 Thread RichardAtHome
Enrique, You could still use the regular forms: ?php echo $form-create('Search',array('url' = '/search','type' = 'get')) ? ?php echo $form-text('query',array('type' = 'textarea')) ? ?php echo $form-end('Search!') ? On Aug 26, 11:45 am, Enrique Delgado [EMAIL PROTECTED] wrote: Hi

Forms not associated to models - alternative to the Form core helper?

2008-08-26 Thread Enrique Delgado
Hi All, The core Form helper works great as long as you have a model behind it, but what about forms that are not related to a model? Is there any helpers that I can use in the view? Or do I just code plain HTML? Thanks! --~--~-~--~~~---~--~~ You received

Re: Forms not associated to models - alternative to the Form core helper?

2008-08-26 Thread Samuel DeVore
On Tue, Aug 26, 2008 at 8:45 AM, Enrique Delgado [EMAIL PROTECTED] wrote: Hi All, The core Form helper works great as long as you have a model behind it, but what about forms that are not related to a model? Is there any helpers that I can use in the view? Or do I just code plain HTML

Re: Forms not associated to models - alternative to the Form core helper?

2008-08-26 Thread validkeys
Hey Enrique, You could still use the regular forms: ?php echo $form-create('Search',array('url' = '/search','type' = 'get')) ? ?php echo $form-text('query',array('type' = 'textarea')) ? ?php echo $form-end('Search!') ? On Aug 26, 11:45 am, Enrique Delgado [EMAIL PROTECTED] wrote: Hi All

Re: Forms not associated to models - alternative to the Form core helper?

2008-08-26 Thread Enrique Delgado
for pointing this out. I was getting too caught up and spoiled by the input() automagic method, my bad. Using the regular methods works just fine. Thanks! On Aug 26, 11:15 am, validkeys [EMAIL PROTECTED] wrote: Hey Enrique, You could still use the regular forms: ?php echo $form-create('Search

Re: One to many forms with ajax

2008-07-12 Thread Andraž
Did you find the solution? --~--~-~--~~~---~--~~ 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

Possible security risk when saving data in forms - adding fields

2008-07-05 Thread phpjoy
When getting a form from a user, it should be double checked in the user's action logic. A user could easily manipulate a form field to submit a new field to the server, like id=4294967294, and stuck the users table. The user could guess, of course, other field names, or see other forms/views

Re: Possible security risk when saving data in forms - adding fields

2008-07-05 Thread Dr. Tarique Sani
On Sat, Jul 5, 2008 at 11:37 AM, phpjoy [EMAIL PROTECTED] wrote: Throughout the examples in the manual (1.2 and 1.1), I haven't noticed any reminder of that possible risk, though I noticed the bad http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd428f5c81 Notice the third

Re: Possible security risk when saving data in forms - adding fields

2008-07-05 Thread the_woodsman
I think you can also do this globally for a model using its $whitelist field. On Jul 5, 7:11 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote: On Sat, Jul 5, 2008 at 11:37 AM, phpjoy [EMAIL PROTECTED] wrote: Throughout the examples in the manual (1.2 and 1.1), I haven't noticed any reminder of

Re: Editing model's primary key in forms

2008-07-01 Thread Bryan D
Thanks guys, that works perfectly. I take it the Player.id form is now preferred over Player/id ? I ported my app from Cake 1.1 to 1.2, and probably missed a few things. On Jun 30, 4:41 am, Jonathan Snook [EMAIL PROTECTED] wrote: On Sun, Jun 29, 2008 at 6:19 AM, Mr. Matt [EMAIL PROTECTED]

Re: Editing model's primary key in forms

2008-07-01 Thread Jonathan Snook
Yes, that's correct. It now uses a period instead of a slash. On Tue, Jul 1, 2008 at 1:50 PM, Bryan D [EMAIL PROTECTED] wrote: Thanks guys, that works perfectly. I take it the Player.id form is now preferred over Player/id ? I ported my app from Cake 1.1 to 1.2, and probably missed a few

Re: Editing model's primary key in forms

2008-06-30 Thread Mr. Matt
I believe this should work: ?php echo $form-input('Player/id', array('type' = 'text')); ? On Jun 27, 5:54 pm, Bryan D [EMAIL PROTECTED] wrote: I would like to allow a model's primary key field (named id) to be editable, at least upon creation of a new object. I noticed that using syntax

Re: Editing model's primary key in forms

2008-06-30 Thread Jonathan Snook
On Sun, Jun 29, 2008 at 6:19 AM, Mr. Matt [EMAIL PROTECTED] wrote: I believe this should work: ?php echo $form-input('Player/id', array('type' = 'text')); ? Just to clarify, it's Player.id (notice the . instead of the /) --~--~-~--~~~---~--~~ You received

Editing model's primary key in forms

2008-06-28 Thread Bryan D
I would like to allow a model's primary key field (named id) to be editable, at least upon creation of a new object. I noticed that using syntax like: ?php echo $form-input('Player/id') ? doesn't work because CakePHP converts it to a hidden field automatically. Is there some way I can override

Re: Form validation - multiple forms and multiple tables used per model

2008-06-17 Thread Marcelius
:-) http://manual.cakephp.org/view/125/data-validation http://api.cakephp.org/class_model.html On 16 jun, 23:42, koala kid [EMAIL PROTECTED] wrote: Hi, I am using one model to process and save the data for multiple forms. How do I run cake's validation methods on each form separately

Re: Form validation - multiple forms and multiple tables used per model

2008-06-17 Thread koala kid
Hi, thanks for your help, its really appreciated. I'm new to cake and although I know its going to be beneficial in the long run right now the learning curve sucks and what really makes it worse is the lack of decent documentation. For example the behaviour you gave me the link to seems to do

Re: Form validation - multiple forms and multiple tables used per model

2008-06-17 Thread koala kid
Ok, I dug around and found out what to name the file and where to save it, I think. I saved the file as multi_validate.php in app/models/ behaviours/. Is this correct? I then defined my rules eg: var $validationSets = array( 'admin' = array(

Re: Form validation - multiple forms and multiple tables used per model

2008-06-17 Thread koala kid
OK, I think I worked out what to name the file and where to save it: app/models/behaviours/multi_validate.php. However I can't get it to work. The form submits without validating. I first set my validation rules in the model eg: var $actsAs = array('MultiValidatable'); /**

Form validation - multiple forms and multiple tables used per model

2008-06-16 Thread koala kid
Hi, I am using one model to process and save the data for multiple forms. How do I run cake's validation methods on each form separately. At the moment you appear to define your rules in $validate outside of any functions/methods. How do I run it from within a method. In addition as my model

Re: Formatting Forms

2008-05-03 Thread [EMAIL PROTECTED]
I think you are over generalizing the standard (recommended by w3c) that tables shouldn't be used for web page layouts. It's fine to use tables to format data and forms, it's also just as fine not to use tables for format forms. Don't feel bad about using tables to format forms :). Take Care

Formatting Forms

2008-05-02 Thread annie.r.knight
Hi all. I have an app with a number of long forms in. These forms are formatted in tables with each row looking something like: thInput Label/thtdText Box [Or Whatever]/td. While the long term solution clearly is to migrate this to CSS design I'm going for the quick (and dirty) solution for now

<    1   2   3   4   5   6   >