mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Completamento blocchi denominazione e nome-cognome
This commit is contained in:
parent
25c2eead97
commit
6828f01536
@ -100,3 +100,27 @@ echo
|
||||
</div>
|
||||
</div>
|
||||
</form>';
|
||||
?>
|
||||
|
||||
<script>
|
||||
// Abilito solo ragione sociale oppure solo nome-cognome in base a cosa compilo
|
||||
$('#nome, #cognome', '#bs-popup').keyup(function(){
|
||||
if ($('#nome', '#bs-popup').val() == '' && $('#cognome', '#bs-popup').val() == '' ){
|
||||
$('#nome, #cognome', '#bs-popup').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale', '#bs-popup').prop('disabled', false).prop('required', true);
|
||||
}else{
|
||||
$('#nome, #cognome', '#bs-popup').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale', '#bs-popup').prop('disabled', true).prop('required', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#ragione_sociale', '#bs-popup').keyup(function(){
|
||||
if ($('#ragione_sociale', '#bs-popup').val() == '' ){
|
||||
$('#nome, #cognome', '#bs-popup').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale', '#bs-popup').prop('disabled', true).prop('required', false);
|
||||
}else{
|
||||
$('#nome, #cognome', '#bs-popup').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale', '#bs-popup').prop('disabled', false).prop('required', true);
|
||||
}
|
||||
});
|
||||
</script>
|
@ -651,41 +651,28 @@ if (empty($record['deleted_at'])) {
|
||||
$("#lng").val(result.geometry.location.lng());
|
||||
});
|
||||
|
||||
/* Campo nome e cognome*/
|
||||
if ($('#ragione_sociale').val()!='' && $('#ragione_sociale').val() != $('#nome').val()+' '+$('#cognome').val()){
|
||||
$('#nome').prop('disabled', true);
|
||||
$('#cognome').prop('disabled', true);
|
||||
};
|
||||
|
||||
if ($('#nome').val()!='' && $('#cognome').val()!=''){
|
||||
$('#ragione_sociale').prop('disabled', true);
|
||||
$("#ragione_sociale").attr('required', false);
|
||||
};
|
||||
|
||||
// Abilito solo ragione sociale oppure solo nome-cognome in base a cosa compilo
|
||||
$('#nome, #cognome').keyup(function(){
|
||||
if ($('#nome').val() =='' && $('#cognome').val() =='' ){
|
||||
$('#ragione_sociale').prop('disabled', false);
|
||||
$("#ragione_sociale").attr('required', true);
|
||||
if ($('#nome').val() == '' && $('#cognome').val() == '' ){
|
||||
$('#nome, #cognome').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale').prop('disabled', false).prop('required', true);
|
||||
}else{
|
||||
|
||||
$('#ragione_sociale').prop('disabled', true);
|
||||
$("#ragione_sociale").attr('required', false);
|
||||
$('#nome, #cognome').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale').prop('disabled', true).prop('required', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#ragione_sociale').keyup(function(){
|
||||
|
||||
if ($(this).val()!=''){
|
||||
$('#nome').prop('disabled', true);
|
||||
$('#cognome').prop('disabled', true);
|
||||
$("#ragione_sociale").attr('required', true);
|
||||
$('#ragione_sociale').keyup(function(){
|
||||
if ($('#ragione_sociale').val() == '' ){
|
||||
$('#nome, #cognome').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale').prop('disabled', true).prop('required', false);
|
||||
}else{
|
||||
$('#nome').prop('disabled', false);
|
||||
$('#cognome').prop('disabled', false);
|
||||
$("#ragione_sociale").attr('required', false);
|
||||
$('#nome, #cognome').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale').prop('disabled', false).prop('required', true);
|
||||
}
|
||||
});
|
||||
|
||||
$('#ragione_sociale, #nome').trigger('keyup');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user