• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email verf.

#1
[eluser]Lol![/eluser]
Hello!
I have the code:
Code:
<?
echo form_open('cliente/cadastro');

echo form_hidden('id_cliente', $cliente['id_cliente']);

$page_redirect = isset($page_redirect) ? $page_redirect : 'login_ok';
echo form_hidden('redirect', $page_redirect);
?>
<table align='center'>
  <tr>
    <td>* Nome:</td>
    <td>&lt;?=form_input('nome', $cliente['nome']);?&gt;</td>
  </tr>
  <tr>
    <td>Nascimento:</td>
    <td>&lt;?=form_input('nascimento',$cliente['nascimento']);?&gt;</td>
  </tr>
  <tr>
    <td>Endereço:</td>
    <td>&lt;?=form_input('endereco', $cliente['endereco']);?&gt;</td>
  </tr>
  <tr>
    <td>Complemento:</td>
    <td>&lt;?=form_input('complemento',$cliente['complemento']);?&gt;</td>
  </tr>
  <tr>
    <td>Bairro:</td>
    <td>&lt;?=form_input('bairro', $cliente['bairro']);?&gt;</td>
  </tr>
  <tr>
    <td>CEP:</td>
    <td>&lt;?=form_input('cep', $cliente['cep']);?&gt;</td>
  </tr>
  <tr>
    <td>Cidade:</td>
    <td>&lt;?=form_input('cidade', $cliente['cidade']);?&gt;</td>
  </tr>
  <tr>
    <td>Estado:</td>
    <td>&lt;?=form_input('estado', $cliente['estado']);?&gt;</td>
  </tr>
  <tr>
    <td>* DDD:</td>
    <td>&lt;?=form_input('ddd_tel', $cliente['ddd_tel']);?&gt;</td>
  </tr>
  <tr>
    <td>* Telefone:</td><td>&lt;?=form_input('telefone', $cliente['telefone']);?&gt;</td>
  </tr>
  <tr>
    <td>DDD:</td>
    <td>&lt;?=form_input('ddd_cel', $cliente['ddd_cel']);?&gt;</td>
  </tr>
  <tr>
    <td>Celular:</td>
    <td>&lt;?=form_input('celular', $cliente['celular']);?&gt;</td>
  </tr>
  <tr>
    <td>* Email:</td>
    <td>&lt;?=form_input('email', $cliente['email']);?&gt;</td>
  </tr>
  <tr>
    <td>CPF/CNPJ:</td>
    <td>&lt;?=form_input('cpf_cnpj', $cliente['cpf_cnpj']);?&gt;</td>
  </tr>
  <tr>
    <td>RG/Insc.Est.:</td>
    <td>&lt;?=form_input('rg_inscest', $cliente['rg_inscest']);?&gt;</td>
  </tr>
  <tr>
    <td>* Senha:</td>
    <td>&lt;?=form_password('senha', $cliente['senha']);?&gt;</td>
  </tr>
  <tr>
    <td align='center'>&lt;?=form_submit('', 'Salvar');?&gt;</td><td>Os campos com * são obrigatórios</td>
  </tr>
</table>

&lt;?
echo form_close()
?&gt;

How I call an email verification at the "* Email" form?


See ya!

#2
[eluser]optimal[/eluser]
Hello,

There's sample code for server-side validation under the "Validation Class" User Guide topic, located here:

http://ellislab.com/codeigniter/user-gui...ation.html

In particular you'll probably want to use the "valid_email" rule discussed there. If that's not sufficient, the "Callbacks" section describes custom validation.

#3
[eluser]Lol![/eluser]
&lt;?=$this->validation->error_string; ?&gt;
$rules['email'] = "required|valid_email";
$this->validation->set_rules($rules);

I need use this lines, right?
sorry for questions, 'cause I can't test, I need upload just one time the file in the FTP server.




- I was thinking in implementate just one javascript code, to verify the form value, and if isn't an email on the form it don't submit form. Is it possible?


ps; sorry for bad english, ma english su*ks xD

#4
[eluser]optimal[/eluser]
That's part of the solution. There's complete sample code in the "Setting Validation Rules" section located here:

http://ellislab.com/codeigniter/user-gui...ation.html

As it explains, after calling set_rules() you can check the output of $this->validation->run().

Or as you said you could just handle it in JavaScript (which you'll need to code separately and requires users to have JavaScript enabled).

#5
[eluser]Lol![/eluser]
My htmls uses some javascripts, and it alerts to turn JS on.
How I use javascript to verify email form?
I know regex, but i dunno how implementate it on codeigniter forms.

Help me, please xD

#6
[eluser]Lol![/eluser]
Nobody?
How I use javascripts to verify email form?

#7
[eluser]Iksander[/eluser]
Why would you use Javascript to validate an email form? The Validation library handles it very nicely for you, and very simply.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.