Hi everyone.
Help with this problem.
With Google I found this script: -
-
var regiondb = new Object()
-
regiondb["Assente"] = [{value:"Ferie", text:"Ferie"},
-
{value:"Festività abolita", text:"Festività abolita"},
-
{value:"Malattia", text:"Malattia"},
-
{value:"Infortunio", text:"Infortunio"},
-
{value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
-
{value:"Riposo Compensativo", text:"Riposo"},
-
{value:"Permesso retribuito", text:"Permesso"},
-
{value:"Permesso Sind./ARCA", text:"Permesso Sind."},
-
{value:"Ricovero Ospedaliero", text:"Ricovero"},
-
{value:"Part-time", text:"Part-time"},
-
{value:"Assemblea Sindacale", text:"Assemblea"},
-
{value:"Sciopero", text:"Sciopero"},
-
{value:"Aspettativa", text:"Aspettativa"},
-
{value:"Carica Pubblica", text:"Carica Pubblica"},
-
{value:"Da giustificare", text:"Da giustificare"}];
-
-
regiondb["Presente"] = [{value:"Monoperatore", text:"Monoperatore"},
-
{value:"Coppia", text:"Coppia"},
-
{value:"Formazione a tre", text:"Formazione a tre"},
-
{value:"Appoggio", text:"Appoggio"},
-
{value:"Fuori sede", text:"Fuori sede"},
-
{value:"In sede", text:"In sede"}];
-
-
-
function setCities(chooser) {
-
var newElem;
-
var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
-
var cityChooser = chooser.form.elements["tipo_stato_giornaliero"];
-
while (cityChooser.options.length) {
-
cityChooser.remove(0);
-
}
-
var choice = chooser.options[chooser.selectedIndex].value;
-
var db = regiondb[choice];
-
newElem = document.createElement("option");
-
newElem.text = "Seleziona valore";
-
newElem.value = "";
-
cityChooser.add(newElem, where);
-
if (choice != "") {
-
for (var i = 0; i < db.length; i++) {
-
newElem = document.createElement("option");
-
newElem.text = db[ i ].text;
-
newElem.value = db[ i ].value;
-
cityChooser.add(newElem, where);
-
}
-
}
-
-
I change this way:
Have a variable ( associated with the selected value from select Choose a Region ), which can be A or B.
I select the value Presente ( variable A ) from select Choose a Region :
1) When the variable is A, in select Choose a City is: -
-
<option value="Fuori Sede">Fuori Sede</option>
-
<option value="In Sede">In Sede</option>
-
I select the value Presente ( variable B ) from select Choose a Region :
2) When the variable is B in select Choose a City is: -
-
<option value="Coppia">Coppia</option>
-
<option value="Formazione a tre">Formazione a tre</option>
-
<option value="Appoggio">Appoggio</option>
-
<option value="Fuori Sede">Fuori Sede</option>
-
<option value="In Sede">In Sede</option>
-
Is possible?
Regards,
Viki
72 5511 acoder 16,027
Recognized Expert Moderator MVP
Yes, it's possible.
What problems are you having with implementing it?
Yes, it's possible.
What problems are you having with implementing it?
Thanks for your answer.
My problem is:
I not have idea to set this variable A o B in this script...
acoder 16,027
Recognized Expert Moderator MVP
Use the onchange event handler to change the city drop down.
Use the onchange event handler to change the city drop down.
Sorry Acoder.... not understand... for example ?
acoder 16,027
Recognized Expert Moderator MVP
[HTML]<select name="region" onchange="setCi ties(this)">[/HTML] You may need to change the values in the array to the options that you want displayed.
Is already planned in this script: -
-
var regiondb = new Object()
-
regiondb["Assente"] = [{value:"Ferie", text:"Ferie"},
-
{value:"Festività abolita", text:"Festività abolita"},
-
{value:"Malattia", text:"Malattia"},
-
{value:"Infortunio", text:"Infortunio"},
-
{value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
-
{value:"Riposo Compensativo", text:"Riposo"},
-
{value:"Permesso retribuito", text:"Permesso"},
-
{value:"Permesso Sind./ARCA", text:"Permesso Sind"},
-
{value:"Ricovero Ospedaliero", text:"Ricovero"},
-
{value:"Part-time", text:"Part-time"},
-
{value:"Assemblea Sindacale", text:"Assemblea"},
-
{value:"Sciopero", text:"Sciopero"},
-
{value:"Aspettativa", text:"Aspettativa"},
-
{value:"Carica Pubblica", text:"Carica Pubblica"},
-
{value:"Da giustificare", text:"Da giustificare"}];
-
-
regiondb["Presente"] = [{value:"Monoperatore", text:"Monoperatore"},
-
{value:"Coppia", text:"Coppia"},
-
{value:"Formazione a tre", text:"Formazione a tre"},
-
{value:"Appoggio", text:"Appoggio"},
-
{value:"Fuori sede", text:"Fuori sede"},
-
{value:"In sede", text:"In sede"}];
-
-
-
function setCities(chooser) {
-
var newElem;
-
var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
-
var cityChooser = chooser.form.elements["tipo_stato_giornaliero"];
-
while (cityChooser.options.length) {
-
cityChooser.remove(0);
-
}
-
var choice = chooser.options[chooser.selectedIndex].value;
-
var db = regiondb[choice];
-
newElem = document.createElement("option");
-
newElem.text = "Seleziona valore";
-
newElem.value = "";
-
cityChooser.add(newElem, where);
-
if (choice != "") {
-
for (var i = 0; i < db.length; i++) {
-
newElem = document.createElement("option");
-
newElem.text = db[i].text;
-
newElem.value = db[i].value;
-
cityChooser.add(newElem, where);
-
}
-
}
-
-
-
....
-
-
<select name="stato_dipendente" onchange="setCities(this)">
-
<option>Seleziona stato giornaliero</option>
-
<option value="Assente">Assente</option>
-
<option value="Presente">Presente</option>
-
</select></td>
-
-
<select name="tipo_stato_giornaliero" onchange="onChangeStatus(this);"><option>Seleziona tipo stato giornaliero</option>
-
</select>
-
-
In this script implement variable A or B.
acoder 16,027
Recognized Expert Moderator MVP
Oh, I see.
You will need to create separate arrays, e.g. - regiondb["PresenteA"] = [{value:"Fuori sede", text:"Fuori sede"},
-
{value:"In sede", text:"In sede"}];
-
regiondb["PresenteB"] = [{value:"Monoperatore", text:"Monoperatore"},
-
{value:"Coppia", text:"Coppia"},
-
{value:"Formazione a tre", text:"Formazione a tre"},
-
{value:"Appoggio", text:"Appoggio"},
-
{value:"Fuori sede", text:"Fuori sede"},
-
{value:"In sede", text:"In sede"}];
-
-
-
function setCities(chooser) {
-
...
-
var choice = chooser.options[chooser.selectedIndex].value;
-
var db = regiondb[choice+regionVar]; // regionVar is A or B
Sorry... but:
Error: 'regionVar' is undefined
:(
acoder 16,027
Recognized Expert Moderator MVP
I know, that was just an example. I expected that you'd set it somewhere.
I'm not sure when it has to change. That's not clear from what you've posted so far.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: CJM |
last post by:
I'm building a search function for one of my applications. The user has the
option to enter a number criteria of criteria, but none are compulsary. I
need to be able to build up a query string that includes only the right
criteria. The simplest way I have found is something like this:
sSQL = "Select field1, field2, etc form table where 1=1"
If Request.Form("Criteria1") <> "" then
sSQL = sSQL & " and criteria1 = " &...
|
by: jtwright |
last post by:
I've got a view that creates a parent child relationship, this view is
used in Analysis Services to create a dimension in a datastore. This
query tends to deadlock after about 10 days of running smoothly. Only
way to fix it is to reboot the box, I can recycle the services for a
quick fix but that usually only works for the next 1-2 times I call the
view.
This view is used to create a breakdown of the bill-to locations from...
|
by: Bob Bedford |
last post by:
I've a form that use a combobox along with other fields. When the user
submit the form, many tests are done. If any test fails, then I show the
form again with previously entered values.
My problem: when I show back the form with previously entered values, I
can't set the entered value of the combobox. I've registered the value, but
how to go trough the value, and select the right one.
I'd like something like:
|
by: Susan Bricker |
last post by:
The following error:
"The current field must match the join key '?' in the table that seves
as t the 'one' side of one-to-many relationship. Enter a record in the
'one' side table with the desired key value, and then make the entry
with the desired join key in the 'many-only' table."
... happens when I click on an entry of a combobox. HELP!!
Here's the background:
|
by: charliewest |
last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list
to a ComboBox control using the "DataSource" property. I have set the
DisplaySource and ValueMember properties as well. The control populates well,
both the display values, and selected values.
However, when i try to "set" the SelectedValue or SelectedIndex properties,
nothing happens.... The default blank value in the ComboBox is always
selected. My code is:
...
| |
by: Becker |
last post by:
I have a need for a simple combobox on a form in one of my programs that
represents city, state. I want to have it autocomplete as the user types.
I have a table with these values (about 50k of them) and I'd like to source
it from there.
I have seen some methods out there for the autocomplete, but I think that
pulling 50k in the combobox might be too slow at runtime to build a table of
all those records and then bind the entire combobox...
|
by: Don |
last post by:
Is there any way to detect when an item has been added to the Items
collection of a combobox or listbox? I am inheriting a Combobox and want to
validate items before they are added to the combobox, but I can't find
anything that will let me do that.
- Don
|
by: John |
last post by:
Hi
There is a <select name='city'item with <optionin the HTML <form
name='france'>
I have tried using the following in a JS routine:
<a
href="javascript:window.opener.document.france.city.options.selected=true;
window.close();"></a>
I get
|
by: Sudhakar |
last post by:
i have two select tags as part of a registration form, city1 city2
where city1 has a list of regions and similar for city2
there are different regions for city1 and city2 so instead of all the
regions appearing one after the other i would like to create a blank
option followed by the next set of regions for formatting purpose
only.
ex=
<select name="city1">
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |