Saturday, September 17, 2011

ajax observeField()

Hi guys,

i have a problem using this ajax function, i'm new on cakephp and
don't know if i'm making a mistake.
I hace a observeFiel in my view as follows:
<?php echo $this->Form->create('ArchivosSistema', array('action' =>
'add1'));?>
<fieldset>
<legend><?php __('Agregar un archivo al sistema'); ?></legend>
<p>Por favor llene los siguientes campos: <br />Datos para
crear archivo:</p>
<?php
echo $this->Form->input('proveedore_id');
echo $this->Form->input('nombre_archivo');
echo $this->Form->input('token_separador');
echo $this->Form->input('Tabla_Correspondiente', array('options' =>
$campos, 'empty'=>'--Seleccionar--'));
?>
<?php
echo $ajax->observeField( 'ArchivosSistemaTokenSeparador',
array('url' => array( 'action' => 'myfunction' ), 'frequency' =>
0.1,));
</fieldset>
<?php echo $this->Form->end(__('Aceptar', true));?>

and in my controller i have 'myFunction' just doing an echo as
follows:

class ArchivosSistemasController extends AppController {

var $name = 'ArchivosSistemas';
var $helpers = array('Html','Ajax','Javascript');
var $components = array( 'RequestHandler' );

all other functions goes here.....

function myfunction(){
echo "Llama la funcion";
}

}

but it does anything when i change the value to the field
token_separador, can anyone help

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate