Video : Ajax Form Validation in CakePHP 1.3 using Jquery

2011-01-21 Thread Azril Nazli
Ever try to simulate $ajax->observeField() in Cake using Jquery, the
following video shows you how

URL : http://www.php.net.my/forum/video-cakephp-validation-jquery

- the video has no audio so you need to pay attention to whatever I
typed
- recorded using CamStudio in AVI and later converted to FLV, you will
need FLV player

-- 
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


Ajax form validation

2009-02-12 Thread faifas

Hello,

I have a form that is being submitted via ajax:

add.ctp
form(null, 'post', array('update' => 'ajax', 'url' => array
('controller' => 'characters', 'action' => 'add')))?>
input('name', array('label' => __('Character name', true)))?
>
end(__('Create character', true))?>

form is submited fine, validation seems to work, I can see error
message when I do pr($this);

However, I only get a same form with a different value when I submit
it, but I can not see any error messages.

Controller:
function add(){
$this->layout = 'ajax';
if (!empty($this->data)){
if ($this->Character->save($this->data)){

}
}
}


And my model:
var $validate = array(
'name' => array(
'rule' => 'alphaNumeric'
 )
);

Any ideas why I cannot see any error messages without echoing them?

Thanks in advance,
faifas

--~--~-~--~~~---~--~~
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: ajax form validation

2008-05-23 Thread Keith

Hi Oli,

Basically you're just looking for client side form validation.  You'd
want to write some kind of interpreter that would take the model-based
validation from CakePHP and translate it into Javascript that would
load when the form loads so that it could be triggered with
"onChange()" or something like that.

There is a sfFormValidation plugin for Symfony that does this, so you
might take a peek at it if you need any idea conceptually how it
works.

- Keith

On May 22, 1:34 pm, Oli <[EMAIL PROTECTED]> wrote:
> hey,
>
> can someone explain me howto validate a form using ajax?
> submission works fine but ive no clue how to validate the form
> correctly before saving the data
>
> oli
--~--~-~--~~~---~--~~
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: ajax form validation

2008-05-22 Thread francky06l

Ajax or not does not change anything (unless you want to do something
special in the form).
Usually you would put your form in a "div" (in the ajax call you
should set this div' id's as parameter for update), when submitting
and trying to save, if it fails just render the same form. This one
(with the error set) is goinf to replace the content of the first
div ...

hth

On May 22, 8:10 pm, jonknee <[EMAIL PROTECTED]> wrote:
> On May 22, 1:34 pm, Oli <[EMAIL PROTECTED]> wrote:
>
> > hey,
>
> > can someone explain me howto validate a form using ajax?
> > submission works fine but ive no clue how to validate the form
> > correctly before saving the data
>
> Validation occurs just the same as a normal request. I don't use the
> AJAX helpers (mixing JS and HTML is a deal breaker for me), but it
> might just be that you're not seeing the error messages. If your
> controller is programmed properly you don't need to know if it's an
> AJAX request or not--it's all HTTP POST.
--~--~-~--~~~---~--~~
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: ajax form validation

2008-05-22 Thread jonknee

On May 22, 1:34 pm, Oli <[EMAIL PROTECTED]> wrote:
> hey,
>
> can someone explain me howto validate a form using ajax?
> submission works fine but ive no clue how to validate the form
> correctly before saving the data
>

Validation occurs just the same as a normal request. I don't use the
AJAX helpers (mixing JS and HTML is a deal breaker for me), but it
might just be that you're not seeing the error messages. If your
controller is programmed properly you don't need to know if it's an
AJAX request or not--it's all HTTP POST.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ajax form validation

2008-05-22 Thread Oli

hey,

can someone explain me howto validate a form using ajax?
submission works fine but ive no clue how to validate the form
correctly before saving the data

oli

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cakephp 1.2 Ajax form validation

2007-12-29 Thread Alberto Lopez Rubio

I was trying to make a form and validate with ajax like in:

http://bin.cakephp.org/view/242085627

but when I have an error, the error div is updated with the content of
the view of the rendered element. so it's displayed twice the form

my validateField view is the form... what should be the validateField
view? if this is the problem...

Thank you

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Ajax form validation with 1.2

2007-09-12 Thread Dia

hi

I'm looking for an example / tutorial showing how to validate forms
with Ajax in CakePHP 1.2

the only thing I found is : http://bin.cakephp.org/view/242085627

does anyone has something else ?

thanks


--~--~-~--~~~---~--~~
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: AJAX - Form Validation

2006-08-25 Thread Rafafa

try this:

var $helpers = array('Ajax');


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: AJAX - Form Validation

2006-08-23 Thread Simplerules

I tried to include the 'Ajax' helper but it could not find it.

var $components = array('Cookies', 'Logins', 'Geoip',
'RequestHandler');
var $helpers = array('AJAX');

It says
You are seeing this error because the view helper file
app\views\helpers\ajax.php can't be found or doesn't exist


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



AJAX - Form Validation

2006-08-23 Thread Simplerules

I am trying to use AJAX to validate a form, I have a tick box next to
my register form inputs. So when a user enters a username, I want the
javascript to call the script and get a response wether the username is
taken.

I have looked at the AJAX helper manual and can't find much to help me,
I've looked at the script.aculo.us site and not found an example of
this and I do not have the faintest idea how to construct it.

Could somebody give the basic instructions or code?

:)


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---