Forum Moderators: open
function ff_CselRegion_action(element, action)
{
country = ff_getElementByName('CselCountry');
state = ff_getElementByName('CselState');
var armeniaArray = new Array('Registration', 'Basic', 'Credit');
var azerbaijanArray = new Array('Registration', 'Basic', 'Credit');
var belarusArray = new Array('Registration', 'Basic', 'Credit');
var bosniaArray = new Array('Registration', 'Basic', 'Credit');
var bulgariaArray = new Array('Registration', 'Basic', 'Credit');
var croatiaArray = new Array('Registration', 'Basic', 'Credit');
var czechrepublicArray = new Array('Registration', 'Basic', 'Credit');
var latviaArray = new Array('Registration', 'Basic', 'Credit');
if (element.value == 'none') {
// drop countries
while (country.options.length > 0)
country.options[country.options.length-1] = null;
} else {
// get the matching array
var selectedArray = eval(element.value+'Array');
// drop supernumerous option
while (selectedArray.length < country.options.length-1)
country.options[country.options.length-1] = null;
// add the new options
country.options[0] = new Option('Selecteer type rapport', 'none', true, true);
for (var i=0; i < selectedArray.length; i++)
country.options[i+1] =
new Option(selectedArray[i], selectedArray[i]);
} // if
// drop states
while (state.options.length > 0)
state.options[state.options.length-1] = null;
} // ff_CselRegion_action
Validate script:
function ff_CselRegion_validation(element, message)
{
if (element.value=='none') {
if (message=='') message = "Please select region.\n";
ff_validationFocus(element.name);
return message;
}
return '';
}
function ff_CselCountry_action(element, action)
{
state = ff_getElementByName('CselState');
var stateArray = new Array('immediate', 'normal', 'express', 'flash');
if (element.value=='Registration') {
// drop supernumerous option
while (stateArray.length < state.options.length-1)
state.options[state.options.length-1] = null;
// add the new options
state.options[0] = new Option('Selecteer snelheid', 'none', true, true);
for (var i=0; i < stateArray.length; i++)
state.options[i+1] = new Option(stateArray[i], stateArray[i]);
} else {
while (state.options.length > 0)
state.options[(state.options.length - 1)] = null;
} // if
} //ff_CselCountry_action function ff_CselCountry_validation(element, message)
{
if (element.value=='none' || element.value=='') {
if (message=='') message = "Please select country.\n";
ff_validationFocus(element.name);
return message;
}
return '';
} function ff_CselState_validation(element, message)
{
if (ff_getElementByName('CselCountry').value=='USA')
if (element.value=='none' || element.value=='') {
if (message=='') message = "Please select state.\n";
ff_validationFocus(element.name);
return message;
}
return '';
}