Re: how can I check if form button is pressed?
first of all thx to both of you. i appreciate it. @Dan: cake outputs: no characters in the first row (i guess thats for this.data??) and then: Array { } @sunsu did not work^^although it makes sense..even to me lol On 4 Aug., 16:00, sunsu sunsu sushil231...@gmail.com wrote: hi, give the submit button a name and use it in the IF condition it works. input type=submit name=m / if(m) {fdkjghkgjndfkghkg} On Wed, Aug 4, 2010 at 6:36 AM, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
oh..if i name the button 'tut' then the array says: Array { [tut] = } On 5 Aug., 09:37, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: first of all thx to both of you. i appreciate it. @Dan: cake outputs: no characters in the first row (i guess thats for this.data??) and then: Array { } @sunsu did not work^^although it makes sense..even to me lol On 4 Aug., 16:00, sunsu sunsu sushil231...@gmail.com wrote: hi, give the submit button a name and use it in the IF condition it works. input type=submit name=m / if(m) {fdkjghkgjndfkghkg} On Wed, Aug 4, 2010 at 6:36 AM, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
oki...got it :) i named the buttton and checked for params forms nameofbutton thanx to you :) On 5 Aug., 09:40, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: oh..if i name the button 'tut' then the array says: Array { [tut] = } On 5 Aug., 09:37, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: first of all thx to both of you. i appreciate it. @Dan: cake outputs: no characters in the first row (i guess thats for this.data??) and then: Array { } @sunsu did not work^^although it makes sense..even to me lol On 4 Aug., 16:00, sunsu sunsu sushil231...@gmail.com wrote: hi, give the submit button a name and use it in the IF condition it works. input type=submit name=m / if(m) {fdkjghkgjndfkghkg} On Wed, Aug 4, 2010 at 6:36 AM, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
Since you're creating your form with model 'ABC', your data array should look like $this-data['ABC'][] So instead of checking for the presence of data in it's entirety, check for that specific key: if( !empty( $this-data['ABC'] ) ) { // execute saving method } If you were sending data along too, such as echo $form-hidden('id'); // still assuming the ABC model Then you could check for if( !empty( $this-data['ABC']['id'] ) ) { // run operation } -dan On Aug 4, 6:36 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
thx dan. unfortunately it does not work yet. in my function i did print_r($this-data['Linkable']; to see whats in the array. since there is no output at all, i assume the array is empty. that explains the no reaction on if !empty, right? i also tried adding a hidden field echo $form-hidden('test'); and wrote in my function: if( !empty( $this-data['ABC']['test'] ) ) { to make sure a value is given for sure still nothingany idea? thx On 4 Aug., 16:20, Dan Heberden danheber...@gmail.com wrote: Since you're creating your form with model 'ABC', your data array should look like $this-data['ABC'][] So instead of checking for the presence of data in it's entirety, check for that specific key: if( !empty( $this-data['ABC'] ) ) { // execute saving method } If you were sending data along too, such as echo $form-hidden('id'); // still assuming the ABC model Then you could check for if( !empty( $this-data['ABC']['id'] ) ) { // run operation } -dan On Aug 4, 6:36 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
Can you post the whole output of: pr( $this-data ); pr( $this-params['form'] ); for me? On Aug 4, 7:35 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: thx dan. unfortunately it does not work yet. in my function i did print_r($this-data['Linkable']; to see whats in the array. since there is no output at all, i assume the array is empty. that explains the no reaction on if !empty, right? i also tried adding a hidden field echo $form-hidden('test'); and wrote in my function: if( !empty( $this-data['ABC']['test'] ) ) { to make sure a value is given for sure still nothingany idea? thx On 4 Aug., 16:20, Dan Heberden danheber...@gmail.com wrote: Since you're creating your form with model 'ABC', your data array should look like $this-data['ABC'][] So instead of checking for the presence of data in it's entirety, check for that specific key: if( !empty( $this-data['ABC'] ) ) { // execute saving method } If you were sending data along too, such as echo $form-hidden('id'); // still assuming the ABC model Then you could check for if( !empty( $this-data['ABC']['id'] ) ) { // run operation } -dan On Aug 4, 6:36 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how can I check if form button is pressed?
hi, give the submit button a name and use it in the IF condition it works. input type=submit name=m / if(m) {fdkjghkgjndfkghkg} On Wed, Aug 4, 2010 at 6:36 AM, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i did react on form submitting a bunch of timesbut it seems different since there is no input field... do i need to place just a button without a form? seems to make sense. dont know if that is possible!!? On 4 Aug., 15:19, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi everyone, this seems really easy, but it's giving me a headache. I have a function in my controller: function createABC() { // save stuff in database } this function is triggered by a form in a view, named createABC.ctp. like this echo $form-create('ABC', array('action' = 'createABC')); echo $form-button('save', array('type' = 'submit')); echo $form-end(); now, I do not want to start the saving procedure everytime the view is called. so i wanna check if this button is hit first. if it is, then save all the data. so i tried to check it like that: function createABC() { if (!empty ($this-data)) { // save stuff in database } } it does not work. anybody know why? huuuge thx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en