[-] FO : Fix #PSCFV-4885 for DNI field, states and postcode display
This commit is contained in:
@@ -86,9 +86,6 @@ $(function(){ldelim}
|
||||
submitFunction();
|
||||
return false;
|
||||
});
|
||||
$('#SubmitCreate').click(function(){
|
||||
submitFunction();
|
||||
});
|
||||
});
|
||||
function submitFunction()
|
||||
{
|
||||
@@ -124,11 +121,12 @@ $(function(){ldelim}
|
||||
$('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>');
|
||||
$('#noSlide').fadeOut('slow', function(){
|
||||
$('#noSlide').html(jsonData.page);
|
||||
// update the state (when this file is called from AJAX you still need to update the state)
|
||||
// update the state (when this file is called from AJAX you still need to update the state)
|
||||
bindStateInputAndUpdate();
|
||||
$(this).fadeIn('slow', function(){
|
||||
document.location = '#account-creation';
|
||||
});
|
||||
});
|
||||
$('#noSlide').fadeIn('slow');
|
||||
document.location = '#account-creation';
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
@@ -339,7 +337,6 @@ $(function(){ldelim}
|
||||
</fieldset>
|
||||
<fieldset class="account_creation dni">
|
||||
<h3>{l s='Tax identification'}</h3>
|
||||
|
||||
<p class="required text">
|
||||
<label for="dni">{l s='Identification number'}</label>
|
||||
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
|
||||
|
||||
@@ -1,84 +1,81 @@
|
||||
/* create account ****************************************************************************** */
|
||||
#account-creation_form {}
|
||||
|
||||
#account-creation_form fieldset, fieldset.account_creation {
|
||||
padding:0 0 15px 0;
|
||||
border:1px solid #ccc;
|
||||
background:#f8f8f8
|
||||
}
|
||||
#account-creation_form h3 {
|
||||
margin:0 0 15px 0;
|
||||
padding:8px;
|
||||
font-size:14px;
|
||||
color:#fff;
|
||||
text-transform:uppercase;
|
||||
background:url(../img/bg_form_h3.png) repeat-x 0 0 #989898
|
||||
}
|
||||
#center_column #account-creation_form p {margin:0; padding:0 0 10px 0}
|
||||
#account-creation_form p.required {color:#222}
|
||||
#account-creation_form p.required sup {color:#990000}
|
||||
|
||||
#account-creation_form p.radio span,
|
||||
#account-creation_form p.text label,
|
||||
#account-creation_form p.password label,
|
||||
#account-creation_form p.select label,
|
||||
#account-creation_form p.select span,
|
||||
#account-creation_form p.textarea label {
|
||||
display:inline-block;
|
||||
padding:6px 15px;
|
||||
width:230px;/* 260 */
|
||||
font-size:14px;
|
||||
text-align:right
|
||||
}
|
||||
#account-creation_form p.radio label {
|
||||
float:none;
|
||||
padding-right:10px;
|
||||
width:auto;
|
||||
font-size:14px
|
||||
}
|
||||
#account-creation_form p.checkbox label {
|
||||
float:none;
|
||||
width:auto;
|
||||
font-size:12px
|
||||
}
|
||||
#account-creation_form p.text input,
|
||||
#account-creation_form p.password input,
|
||||
#account-creation_form p.select input {
|
||||
padding:0 5px;
|
||||
height:22px;
|
||||
width:360px;/* 370 */
|
||||
border:1px solid #ccc;
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
|
||||
#account-creation_form span.inline-infos{display:inline-block;}
|
||||
#account-creation_form p.checkbox input {
|
||||
margin-left:260px;
|
||||
}
|
||||
#account-creation_form p.select select {
|
||||
margin-right:10px;
|
||||
border:1px solid #ccc;
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
#account-creation_form p.textarea textarea {
|
||||
height:80px;
|
||||
width:370px;
|
||||
border:1px solid #ccc;
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
|
||||
#account-creation_form span.form_info {
|
||||
display:block;
|
||||
margin:5px 0 0 265px;
|
||||
color:#666
|
||||
}
|
||||
#account-creation_form p.inline-infos {
|
||||
margin:0 0 0 100px !important;
|
||||
font-size:12px;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
#center_column #account-creation_form p.cart_navigation {margin:20px 0}
|
||||
#account-creation_form fieldset, fieldset.account_creation {
|
||||
padding:0 0 15px 0;
|
||||
border:1px solid #ccc;
|
||||
background:#f8f8f8
|
||||
}
|
||||
#account-creation_form h3 {
|
||||
margin:0 0 15px 0;
|
||||
padding:8px;
|
||||
font-size:14px;
|
||||
color:#fff;
|
||||
text-transform:uppercase;
|
||||
background:url(../img/bg_form_h3.png) repeat-x 0 0 #989898
|
||||
}
|
||||
#center_column #account-creation_form p {margin:0; padding:0 0 10px 0}
|
||||
#account-creation_form p.required {color:#222}
|
||||
#account-creation_form p.required sup {color:#990000}
|
||||
#account-creation_form p.radio span,
|
||||
#account-creation_form p.text label,
|
||||
#account-creation_form p.password label,
|
||||
#account-creation_form p.select label,
|
||||
#account-creation_form p.select span,
|
||||
#account-creation_form p.textarea label {
|
||||
display:inline-block;
|
||||
padding:6px 15px;
|
||||
width:230px;/* 260 */
|
||||
font-size:14px;
|
||||
text-align:right
|
||||
}
|
||||
#account-creation_form p.radio label {
|
||||
float:none;
|
||||
padding-right:10px;
|
||||
width:auto;
|
||||
font-size:14px
|
||||
}
|
||||
#account-creation_form p.checkbox label {
|
||||
float:none;
|
||||
width:auto;
|
||||
font-size:12px
|
||||
}
|
||||
#account-creation_form p.text input,
|
||||
#account-creation_form p.password input,
|
||||
#account-creation_form p.select input {
|
||||
padding:0 5px;
|
||||
height:22px;
|
||||
width:360px;/* 370 */
|
||||
border:1px solid #ccc;
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
#account-creation_form span.inline-infos{display:inline-block;}
|
||||
#account-creation_form p.checkbox input {
|
||||
margin-left:260px;
|
||||
}
|
||||
#account-creation_form p.select select {
|
||||
margin-right:10px;
|
||||
border:1px solid #ccc;
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
#account-creation_form p.textarea textarea {
|
||||
height:80px;
|
||||
width:370px;
|
||||
border:1px solid #ccc;
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
#account-creation_form span.form_info {
|
||||
display:block;
|
||||
margin:5px 0 0 265px;
|
||||
color:#666
|
||||
}
|
||||
#account-creation_form p.inline-infos {
|
||||
margin:0 0 0 100px !important;
|
||||
font-size:12px;
|
||||
color:#666;
|
||||
}
|
||||
#account-creation_form .id_state, #account-creation_form .dni, #account-creation_form .postcode {
|
||||
display: none;
|
||||
}
|
||||
#center_column #account-creation_form p.cart_navigation {margin:20px 0}
|
||||
@@ -61,6 +61,7 @@ body.content_only {
|
||||
|
||||
/* positionnement ****************************************************************************** */
|
||||
.hidden {display:none}
|
||||
.f_left {float:left}
|
||||
.f_right {float:right}
|
||||
p.center {text-align:center}
|
||||
.clearBoth {clear:both}
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
#orderopc #left_column {display:none}
|
||||
#orderopc #center_column{width:757px}
|
||||
|
||||
#orderopc #left_column h2 {margin-top:20px}
|
||||
|
||||
#opc_account_choice {padding:0 15px;}
|
||||
#opc_account_choice .opc_float {
|
||||
float:left;
|
||||
width:350px
|
||||
}
|
||||
#opc_account_choice .opc_float ul {margin:0 0 20px 30px}
|
||||
|
||||
form#new_account_form {}
|
||||
#new_account_form fieldset {
|
||||
padding:0 0 15px 0;
|
||||
border:1px solid #ccc;
|
||||
@@ -73,13 +69,15 @@ form#new_account_form {}
|
||||
font-size: 12px;
|
||||
color:#666
|
||||
}
|
||||
|
||||
#new_account_form span.form_info,
|
||||
#new_account_form span.inline-infos {
|
||||
display:block;
|
||||
margin:5px 0 0 265px;
|
||||
color:#666
|
||||
}
|
||||
#new_account_form .id_state, #new_account_form .dni, #new_account_form .postcode {
|
||||
display: none;
|
||||
}
|
||||
#opc_account_errors {
|
||||
margin: 10px;
|
||||
margin-bottom: 15px;
|
||||
|
||||
@@ -5,30 +5,28 @@ $(document).ready(function()
|
||||
|
||||
function bindStateInputAndUpdate()
|
||||
{
|
||||
$('.id_state, .dni, .postcode').css({'display':'none'});
|
||||
updateState();
|
||||
updateNeedIDNumber();
|
||||
updateZipCode();
|
||||
|
||||
$('select#id_country').change(function(){
|
||||
updateState();
|
||||
updateNeedIDNumber();
|
||||
updateZipCode();
|
||||
});
|
||||
|
||||
|
||||
if ($('select#id_country_invoice').length !== 0)
|
||||
{
|
||||
$('select#id_country_invoice').change(function(){
|
||||
updateState('invoice');
|
||||
updateNeedIDNumber('invoice');
|
||||
updateZipCode();
|
||||
});
|
||||
if ($('select#id_country_invoice:visible').length !== 0)
|
||||
{
|
||||
$('select#id_country_invoice').change(function(){
|
||||
updateState('invoice');
|
||||
updateNeedIDNumber('invoice');
|
||||
updateZipCode('invoice');
|
||||
}
|
||||
});
|
||||
updateState('invoice');
|
||||
updateNeedIDNumber('invoice');
|
||||
updateZipCode('invoice');
|
||||
}
|
||||
|
||||
updateState();
|
||||
updateNeedIDNumber();
|
||||
updateZipCode();
|
||||
}
|
||||
|
||||
function updateState(suffix)
|
||||
@@ -40,29 +38,26 @@ function updateState(suffix)
|
||||
$(states).each(function (key, item){
|
||||
$('select#id_state'+(suffix !== undefined ? '_'+suffix : '')).append('<option value="'+item.id+'"'+ (idSelectedCountry === item.id ? ' selected="selected"' : '') + '>'+item.name+'</option>');
|
||||
});
|
||||
|
||||
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden, div.id_state'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow');
|
||||
$('.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');;
|
||||
}
|
||||
else
|
||||
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+', div.id_state'+(suffix !== undefined ? '_'+suffix : '')).hide();
|
||||
$('.id_state'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
|
||||
}
|
||||
|
||||
function updateNeedIDNumber(suffix)
|
||||
{
|
||||
var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val());
|
||||
|
||||
if ($.inArray(idCountry, countriesNeedIDNumber) >= 0)
|
||||
$('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow');
|
||||
$('.dni'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');
|
||||
else
|
||||
$('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast');
|
||||
$('.dni'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
|
||||
}
|
||||
|
||||
function updateZipCode(suffix)
|
||||
{
|
||||
var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val());
|
||||
|
||||
if (countriesNeedZipCode[idCountry] !== 0)
|
||||
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow');
|
||||
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');
|
||||
else
|
||||
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast');
|
||||
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user