Forums

validate 2 required fields

sofia 09 Mar, 2008
Hello,

I have some question regarding Chronoforms.

My html for is:
<?php
global $my,$mosConfig_live_site;
// verifica se o utilizador fez login
// o nome e email são preenchidos automáticamente e definidos como read only
$readonl="";
if ($my->id) {
$readonl=" readonly='readonly'";
} else {
}
?>
<table width="500" cellspacing="5">
<tr><td valign="middle"><label for="nome">Nome</label></td>
    <td valign="middle"><input name="nome" type="text" id="nome" value="<?php echo $my->name?>"<?php echo $readonl?> /></td></tr>
    
<tr><td valign="middle"><label for="email">Email</label></td>
    <td valign="middle"><input name="email" type="text" id="email" value="<?php echo $my->email?>"<?php echo $readonl?> /></td></tr>
    
<tr><td valign="middle"><label for="telefone">Telefone</label></td>
	<td valign="middle"><input name="telefone" type="text" id="telefone" /></td></tr>
    
<tr><td valign="top"><label for="detalhes">Detalhes</label></td>
    <td valign="top"><textarea name="detalhes" rows="10" cols="60" id="detalhes">Exponha o caso da forma mais detalhada possível</textarea></td></tr>			

<tr>
  <td valign="middle"><label for="anexos">Anexos</label></td>
  <td valign="middle"><input type="file" name="anexos" id="anexos" /></td></tr>
<tr><td valign="middle"><label for="verificacao">Verificação</label></td>
    <td valign="middle"><!-- os utilizadores registados não vêem esta opção -->
						<?php if(!$my->id){ ?>  
						{imageverification}
						<?php } ?></td></tr>	
       
<tr><td valign="middle"> </td>
    <td valign="middle" align="right"><input type="submit" value="Enviar" class="button"> <input type="reset" value="Limpar" class="button" /></td></tr>			
</table>
I´m using chronoform validation for:
1 required: nome, email
2 numeric: telefone
7 email: email

They all work fine, except required. This one is only considering required the first fiel indicated - nome.

If i don't fullfill email he sends the mail anyway.

I read post in the forum regarding css issues with validation, but i only have class active on buttons.

Is there a way to solve this?

Thanks,

Sofia<br><br>Post edited by: GreyHead, at: 2008/03/09 17:58
GreyHead 09 Mar, 2008
Hi Sofia,

Your code works OK for me . . .

Please see if you have a space in the 'Required' list. If so take it out and try 'email,nome' instead.

Bob
sofia 09 Mar, 2008
You were right.

I had a space. what a stupid thing to do in code ... :sick:

Change it to nome,email without spaces and it worked. There was no need to change the fields order.

Thanks,

Sofia
GreyHead 09 Mar, 2008
Hi Sofia,

Really ChronoForms should strip the spaces. Hopefully Max will add it to his list for the next release.

Bob
This topic is locked and no more replies can be posted.