[-] FO : fixed bug #PSCFV-4526
This commit is contained in:
@@ -123,7 +123,7 @@ $(function(){ldelim}
|
|||||||
$('#noSlide').fadeOut('slow', function(){
|
$('#noSlide').fadeOut('slow', function(){
|
||||||
$('#noSlide').html(jsonData.page);
|
$('#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)
|
||||||
updateState();
|
bindStateInputAndUpdate();
|
||||||
});
|
});
|
||||||
$('#noSlide').fadeIn('slow');
|
$('#noSlide').fadeIn('slow');
|
||||||
document.location = '#account-creation';
|
document.location = '#account-creation';
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function()
|
||||||
|
{
|
||||||
|
bindStateInputAndUpdate();
|
||||||
|
});
|
||||||
|
|
||||||
|
function bindStateInputAndUpdate()
|
||||||
|
{
|
||||||
$('select#id_country').change(function(){
|
$('select#id_country').change(function(){
|
||||||
updateState();
|
updateState();
|
||||||
updateNeedIDNumber();
|
updateNeedIDNumber();
|
||||||
updateZipCode();
|
updateZipCode();
|
||||||
});
|
});
|
||||||
updateState();
|
|
||||||
updateNeedIDNumber();
|
|
||||||
updateZipCode();
|
|
||||||
|
|
||||||
if ($('select#id_country_invoice').length != 0)
|
if ($('select#id_country_invoice').length != 0)
|
||||||
{
|
{
|
||||||
@@ -22,10 +25,15 @@ $(document).ready(function(){
|
|||||||
updateZipCode('invoice');
|
updateZipCode('invoice');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
updateState();
|
||||||
|
updateNeedIDNumber();
|
||||||
|
updateZipCode();
|
||||||
|
}
|
||||||
|
|
||||||
function updateState(suffix)
|
function updateState(suffix)
|
||||||
{
|
{
|
||||||
|
console.log($('select#id_state'+(suffix !== undefined ? '_'+suffix : '')+' option:not(:first-child)'));
|
||||||
$('select#id_state'+(suffix !== undefined ? '_'+suffix : '')+' option:not(:first-child)').remove();
|
$('select#id_state'+(suffix !== undefined ? '_'+suffix : '')+' option:not(:first-child)').remove();
|
||||||
var states = countries[$('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()];
|
var states = countries[$('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()];
|
||||||
if(typeof(states) != 'undefined')
|
if(typeof(states) != 'undefined')
|
||||||
@@ -37,7 +45,8 @@ function updateState(suffix)
|
|||||||
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').slideDown('slow');
|
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').slideDown('slow');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast');
|
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')).hide();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNeedIDNumber(suffix)
|
function updateNeedIDNumber(suffix)
|
||||||
|
|||||||
Reference in New Issue
Block a user