function fillCategory(){ // this function is used to fill the category list on load addOption(document.drop_list.Country, '1', 'England');addOption(document.drop_list.Country, '2', 'Scotland');addOption(document.drop_list.Country, '3', 'Wales');addOption(document.drop_list.Country, '5', 'Islands');} // end of JS function function SelectSubCat(){ // ON or after selection of category this function will work removeAllOptions(document.drop_list.action); addOption(document.drop_list.action, "accommodation", "Select Area", ""); // Collect all element of subcategory for various cat_id if(document.drop_list.Country.value == '1'){addOption(document.drop_list.action,'Bedfordshire', 'Bedfordshire');addOption(document.drop_list.action,'Berkshire', 'Berkshire');addOption(document.drop_list.action,'Bristol', 'Bristol');addOption(document.drop_list.action,'Buckinghamshire', 'Buckinghamshire');addOption(document.drop_list.action,'Cambridgeshire', 'Cambridgeshire');addOption(document.drop_list.action,'Cheshire', 'Cheshire');addOption(document.drop_list.action,'Cornwall', 'Cornwall');addOption(document.drop_list.action,'Cumbria', 'Cumbria');addOption(document.drop_list.action,'Derbyshire', 'Derbyshire');addOption(document.drop_list.action,'Devon', 'Devon');addOption(document.drop_list.action,'Dorset', 'Dorset');addOption(document.drop_list.action,'Durham', 'Durham');addOption(document.drop_list.action,'East Sussex', 'East Sussex');addOption(document.drop_list.action,'Essex', 'Essex');addOption(document.drop_list.action,'Gloucestershire', 'Gloucestershire');addOption(document.drop_list.action,'Greater Manchester', 'Greater Manchester');addOption(document.drop_list.action,'Hampshire', 'Hampshire');addOption(document.drop_list.action,'Herefordshire', 'Herefordshire');addOption(document.drop_list.action,'Hertfordshire', 'Hertfordshire');addOption(document.drop_list.action,'Humberside', 'Humberside');addOption(document.drop_list.action,'Kent', 'Kent');addOption(document.drop_list.action,'Lancashire', 'Lancashire');addOption(document.drop_list.action,'Leicestershire', 'Leicestershire');addOption(document.drop_list.action,'Lincolnshire', 'Lincolnshire');addOption(document.drop_list.action,'London', 'London');addOption(document.drop_list.action,'Merseyside', 'Merseyside');addOption(document.drop_list.action,'Middlesex', 'Middlesex');addOption(document.drop_list.action,'Norfolk', 'Norfolk');addOption(document.drop_list.action,'North Yorkshire', 'North Yorkshire');addOption(document.drop_list.action,'Northamptonshire', 'Northamptonshire');addOption(document.drop_list.action,'Northumberland', 'Northumberland');addOption(document.drop_list.action,'Nottinghamshire', 'Nottinghamshire');addOption(document.drop_list.action,'Oxfordshire', 'Oxfordshire');addOption(document.drop_list.action,'Rutland', 'Rutland');addOption(document.drop_list.action,'Shropshire', 'Shropshire');addOption(document.drop_list.action,'Somerset', 'Somerset');addOption(document.drop_list.action,'South Yorkshire', 'South Yorkshire');addOption(document.drop_list.action,'Staffordshire', 'Staffordshire');addOption(document.drop_list.action,'Suffolk', 'Suffolk');addOption(document.drop_list.action,'Surrey', 'Surrey');addOption(document.drop_list.action,'Tyne & Wear', 'Tyne & Wear');addOption(document.drop_list.action,'Warwickshire', 'Warwickshire');addOption(document.drop_list.action,'West Midlands', 'West Midlands');addOption(document.drop_list.action,'West Sussex', 'West Sussex');addOption(document.drop_list.action,'West Yorkshire', 'West Yorkshire');addOption(document.drop_list.action,'Wiltshire', 'Wiltshire');addOption(document.drop_list.action,'Worcestershire', 'Worcestershire');}if(document.drop_list.Country.value == '2'){addOption(document.drop_list.action,'Aberdeen & Grampian', 'Aberdeen & Grampian');addOption(document.drop_list.action,'Angus & Dundee', 'Angus & Dundee');addOption(document.drop_list.action,'Argyll & The Isles', 'Argyll & The Isles');addOption(document.drop_list.action,'Ayrshire & Arran', 'Ayrshire & Arran');addOption(document.drop_list.action,'Borders', 'Borders');addOption(document.drop_list.action,'Dumfries & Galloway', 'Dumfries & Galloway');addOption(document.drop_list.action,'Edinburgh & Lothian', 'Edinburgh & Lothian');addOption(document.drop_list.action,'Fife', 'Fife');addOption(document.drop_list.action,'Glasgow & The Clyde', 'Glasgow & The Clyde');addOption(document.drop_list.action,'Highlands', 'Highlands');addOption(document.drop_list.action,'Orkney', 'Orkney');addOption(document.drop_list.action,'Perthshire', 'Perthshire');addOption(document.drop_list.action,'Shetland', 'Shetland');addOption(document.drop_list.action,'Skye', 'Skye');addOption(document.drop_list.action,'Stirling & Trossachs', 'Stirling & Trossachs');addOption(document.drop_list.action,'Western Isles', 'Western Isles');}if(document.drop_list.Country.value == '3'){addOption(document.drop_list.action,'Anglesey', 'Anglesey');addOption(document.drop_list.action,'Mid Wales', 'Mid Wales');addOption(document.drop_list.action,'North Wales', 'North Wales');addOption(document.drop_list.action,'South Wales', 'South Wales');addOption(document.drop_list.action,'West Wales', 'West Wales');}if(document.drop_list.Country.value == '5'){addOption(document.drop_list.action,'Channel Isles', 'Channel Isles');addOption(document.drop_list.action,'Isle of Man', 'Isle of Man');addOption(document.drop_list.action,'Isle of Wight', 'Isle of Wight');addOption(document.drop_list.action,'Scilly Isles', 'Scilly Isles');}if(document.drop_list.Country.value == '4'){addOption(document.drop_list.action,'County Antrim', 'County Antrim');addOption(document.drop_list.action,'County Armagh', 'County Armagh');addOption(document.drop_list.action,'County Cavan', 'County Cavan');addOption(document.drop_list.action,'County Clare', 'County Clare');addOption(document.drop_list.action,'County Cork', 'County Cork');addOption(document.drop_list.action,'County Donegal', 'County Donegal');addOption(document.drop_list.action,'County Down', 'County Down');addOption(document.drop_list.action,'County Dublin', 'County Dublin');addOption(document.drop_list.action,'County Fermangh', 'County Fermangh');addOption(document.drop_list.action,'County Galway', 'County Galway');addOption(document.drop_list.action,'County Kerry', 'County Kerry');addOption(document.drop_list.action,'County Kildare', 'County Kildare');addOption(document.drop_list.action,'County Kilkenny', 'County Kilkenny');addOption(document.drop_list.action,'County Laois', 'County Laois');addOption(document.drop_list.action,'County Leitrim', 'County Leitrim');addOption(document.drop_list.action,'County Limerick', 'County Limerick');addOption(document.drop_list.action,'County Longford', 'County Longford');addOption(document.drop_list.action,'County Lononderry', 'County Lononderry');addOption(document.drop_list.action,'County Louth', 'County Louth');addOption(document.drop_list.action,'County Mayo', 'County Mayo');addOption(document.drop_list.action,'County Meath', 'County Meath');addOption(document.drop_list.action,'County Monaghan', 'County Monaghan');addOption(document.drop_list.action,'County Offaly', 'County Offaly');addOption(document.drop_list.action,'County Roscommon', 'County Roscommon');addOption(document.drop_list.action,'County Sligo', 'County Sligo');addOption(document.drop_list.action,'County Tiperary', 'County Tiperary');addOption(document.drop_list.action,'County Tyrone', 'County Tyrone');addOption(document.drop_list.action,'County Waterford', 'County Waterford');addOption(document.drop_list.action,'County Westmeath', 'County Westmeath');addOption(document.drop_list.action,'County Wicklow', 'County Wicklow');addOption(document.drop_list.action,'CountyWexford', 'CountyWexford');} } ////////////////// function removeAllOptions(selectbox) { var i; for(i=selectbox.options.length-1;i>=0;i--) { //selectbox.options.remove(i); selectbox.remove(i); } } function addOption(selectbox, value, text ) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.options.add(optn); }