SD-5 Verif siren valide

This commit is contained in:
Claire DELBOS 2017-03-09 10:17:02 +01:00
parent 7d5cb9bbdb
commit 92db1b7c0d
2 changed files with 17 additions and 6 deletions

View File

@ -155,6 +155,8 @@ class AuthController extends Zend_Controller_Action
->appendStylesheet($this->theme->pathStyle.'/user.css', 'all')
//->appendStylesheet($this->theme->pathStyle.$config['css'], 'all')
;
$this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript');
$request = $this->getRequest();
/**

View File

@ -6,6 +6,7 @@
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
</head>
<body>
@ -19,7 +20,7 @@
<div class="panel panel-default">
<?php echo $this->partial('auth/cgu.phtml',array()); ?>
</div>
<span id="errors"></span>
</div>
<div class="col-md-6">
@ -62,8 +63,8 @@
</div>
<div class="form-group">
<label for="siret">SIRET</label>
<input type="text" class="form-control" id="siret" name="siret" value="<?=$this->FormSiret?>">
<label for="siret">SIRET *</label>
<input type="text" class="form-control" name="siret" value="<?=$this->FormSiret?>">
</div>
<div class="form-group">
@ -81,7 +82,7 @@
<input type="text" class="form-control" name="tel" value="<?=$this->FormTel?>">
</div>
<button class="btn btn-lg btn-primary btn-block clearfix" type="submit">Valider</button>
<button class="btn btn-lg btn-primary btn-block clearfix" id="ssosubmit" type="submit">Valider</button>
<?php }?>
</form>
@ -100,9 +101,17 @@
</div>
<script>
$(function(){
$('#ssoform').submit(function(e){
$('#ssosubmit').click(function(e){
e.preventDefault();
alert($('input[name=siret]').value;
siret=$('input[name=siret]').val();
if(EstSiretValide(siret)){
$('#ssoform').submit();
}else{
$('input[name=siret]').addClass('alert alert-danger');
$('#errors').addClass('alert alert-danger');
$('#errors').html('Veuillez entrer un siret valide pour vous identifier');
}
//$('form[name=cgu]').submit();
});
});