Skip to content

Commit

Permalink
📝 BASE #86
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Nov 17, 2018
1 parent 9efee3b commit ec399a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/classes/webform/TForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6542,7 +6542,7 @@ public function addCpfCnpjField( $strName, $strLabel=null, $boolRequired=null, $
* Exemplo: para informar o cep e preencher o campo des_endereco do formulário automaticamente, fazer assim:
* $frm->addCepField('num_cep','Cep:',true,null,null,'des_endereco');
*
* Chama FormDin4.js getCepJquery que chama getCep.php que utiliza o serviço buscarcep.com.br
* Chama o metodo getCepJquery no arquivo FormDin4Cep.js que chama getCep.php que utiliza o serviço buscarcep.com.br
* Esse serviço é pago em 13-10-2017 estava disponivel a consulta gratuida via xml
*
* @param string $strName - 1: Id do campo
Expand Down Expand Up @@ -6639,7 +6639,9 @@ public function addCepField( $strName
if( $qtd > 0 )
{
$buttonName = $field->getId() . '_btn_consultar';
$buttonOnClick = 'getCepJquery("' . $field->getId() . '",' . json_encode( $arrFields ) . ',' . ($jsCallback ? $jsCallback : 'null'). ',' . ($jsBeforeSend ? $jsBeforeSend : 'null').')';
$getCepJsCallback = ($jsCallback ? $jsCallback : 'null');
$getCepJsBeforeSend = ($jsBeforeSend ? $jsBeforeSend : 'null');
$buttonOnClick = 'getCepJquery("' . $field->getId() . '",'.json_encode( $arrFields ).','.$getCepJsCallback.','.$getCepJsBeforeSend.')';
$button = new TButton( $buttonName , 'Consultar', null, $buttonOnClick, null, null, null, 'Infome o CEP e clique aqui para autocompletar os campos de endereço.' );
$field->addEvent( 'onKeyUp', 'fwFieldCepKeyUp(this,event,"' . implode( ',', $arrClearFields ) . '")' );
$field->add( $button );
Expand Down

0 comments on commit ec399a8

Please sign in to comment.