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
Apr 3 '08
72 5337
Oh, I see! I thought you wanted to get rid of the alert for "Presente".
The reason why you don't see the alert for Assente is that it's defined. To get around that, either create duplicates AssenteA and AssenteB and get rid of Assente, then change the code to add regionVar to 'choice' all the time (not just with "Presente"), OR (for an easier and probably better solution) rather than check that db is defined, just check that regionVar is not empty.
Oh, I see! I thought you wanted to get rid of the alert for "Presente".
The reason why you don't see the alert for Assente is that it's defined. To get around that, either create duplicates AssenteA and AssenteB and get rid of Assente, then change the code to add regionVar to 'choice' all the time (not just with "Presente"), OR (for an easier and probably better solution) rather than check that db is defined, just check that regionVar is not empty.
Ok, i write:
[php]
var regionVar = "";
var reg = document.getElementById("reg");
for (i=0; i < reg.options.length; i++) {
if (reg.options[i].selected) {
regionVar = reg.options[i].value.split("-")[0];
break;
}
}
var choice = chooser.options[chooser.selectedIndex].value;
if (choice == "Presente") choice += regionVar;
var db = regiondb[choice];
if(regionVar != null) {
alert('KO');
return;
}
[/php]
But the regionVar is ever null....
Sorry, that should be the other way round:
Sorry, that should be the other way round:
Many thanks Acoder....
[php]
if(regionVar == "") {
alert('KO');
location.href="select.asp"
return;
}
[/php]
I hope close now.... thanks...
Many thanks Acoder....
You're welcome again!
[php]
if(regionVar == "") {
alert('KO');
location.href="select.asp"
return;
}
[/php]
Why reload the page?
I hope close now.
Probably not, LOL!
Then you do away with that by adding the option first before making the regionVar check: - newElem = document.createElement("option");
-
newElem.text = "Seleziona valore";
-
newElem.value = "";
-
cityChooser.add(newElem, where);
Then you do away with that by adding the option first before making the regionVar check: - newElem = document.createElement("option");
-
newElem.text = "Seleziona valore";
-
newElem.value = "";
-
cityChooser.add(newElem, where);
sorry, i do not understand your data...
Swap that code and the regionVar check around: - var regionVar = "";
-
var reg = document.getElementById("reg");
-
for (i=0; i < reg.options.length; i++) {
-
if (reg.options[i].selected) {
-
regionVar = reg.options[i].value.split("-")[0];
-
break;
-
}
-
}
-
-
var choice = chooser.options[chooser.selectedIndex].value;
-
-
if (choice == "Presente") choice += regionVar;
-
var db = regiondb[choice];
-
-
newElem = document.createElement("option");
-
newElem.text = "Seleziona valore";
-
newElem.value = "";
-
cityChooser.add(newElem, where);
-
-
if (regionVar == "") {
-
alert("KO");
-
return;
-
}
-
-
if (choice != "" && regionVar != "")
-
You're welcome yet again!
You're welcome yet again!
Hi my friend Acoder.... I still... :-)
It is possible when you invoke the page select.asp have this situation ?
You explain:
1) in the select name="SelectMultipla" preselected first value of the list ( in this example = DVD );
2) in the select name="stato_dipendente" preselected value Presente;
3) in the select name="stato_dipendente" values Fuori sede and In sede;
Thanks for your help...
viki
1) in the select name="SelectMultipla" preselected first value of the list ( in this example = DVD );
2) in the select name="stato_dipendente" preselected value Presente;
3) in the select name="stato_dipendente" values Fuori sede and In sede;
No need for JavaScript, though you could use JavaScript too.
Just add selected to the options that need preselecting: - <option value="A-DVD" selected>DVD</option>
For the third select, just put the options in the HTML code.
No need for JavaScript, though you could use JavaScript too.
Just add selected to the options that need preselecting: - <option value="A-DVD" selected>DVD</option>
For the third select, just put the options in the HTML code.
Thanks, i have:
[php]
<select size="8" id="reg" name="SelectMultipla" multiple="multiple">
<option>Select</option>
<option value="A-DVD" selected>DVD</option>
<option value="A-DVDR">DVDR</option>
<option value="B-CDR">CDR</option>
<option value="B-CD">CD</option>
</select>
<select name="stato_dipendente" onchange="setCities(this)">
<option>Seleziona stato giornaliero</option>
<option value="Assente">Assente</option>
<option value="Presente" selected>Presente</option>
</select></td>
<select name="tipo_stato_giornaliero">
<option>Seleziona tipo stato giornaliero</option>
</select>
[/php]
But the third select is empty.... not values In sede and Fuori sede... http://www.complessobandisticopalomb...67/select2.asp
Yes, add them yourself in the HTML: - <select name="tipo_stato_giornaliero">
-
<option>Seleziona tipo stato giornaliero</option>
-
<option>In sede</option>
-
<option>Fuori sede</option>
-
</select>
Yes, add them yourself in the HTML: - <select name="tipo_stato_giornaliero">
-
<option>Seleziona tipo stato giornaliero</option>
-
<option>In sede</option>
-
<option>Fuori sede</option>
-
</select>
Many thanks again... again mi friend Acoder... ;-)
Glad to help!
This is historic post with many answers... is unique post with many answers ?
It has a number of different threads of discussion relating to the same problem, so yeah, maybe unique in that respect, but some threads in the Access forum are pretty long with many contributors.
Hope others find it useful too.
It has a number of different threads of discussion relating to the same problem, so yeah, maybe unique in that respect, but some threads in the Access forum are pretty long with many contributors.
Hope others find it useful too.
You are welcome and I'am very happy to found this Community !!!
Glad to hear it.
I think we'll leave it there, otherwise this thread could become a lot longer than it already is ;)
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...
|
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
|
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,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |