473,387 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Select combobox Region ==> City

263 100+
Hi everyone.

Help with this problem.

With Google I found this script:

Expand|Select|Wrap|Line Numbers
  1.  
  2. var regiondb = new Object()
  3. regiondb["Assente"] = [{value:"Ferie", text:"Ferie"},
  4.                       {value:"Festivitą abolita", text:"Festivitą abolita"},
  5.                       {value:"Malattia", text:"Malattia"},
  6.                       {value:"Infortunio", text:"Infortunio"},
  7.                       {value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
  8.                       {value:"Riposo Compensativo", text:"Riposo"},
  9.                       {value:"Permesso retribuito", text:"Permesso"},
  10.                       {value:"Permesso Sind./ARCA", text:"Permesso Sind."},
  11.                       {value:"Ricovero Ospedaliero", text:"Ricovero"},
  12.                       {value:"Part-time", text:"Part-time"},
  13.                       {value:"Assemblea Sindacale", text:"Assemblea"},
  14.                       {value:"Sciopero", text:"Sciopero"},
  15.                       {value:"Aspettativa", text:"Aspettativa"},
  16.                       {value:"Carica Pubblica", text:"Carica Pubblica"},
  17.                       {value:"Da giustificare", text:"Da giustificare"}];
  18.  
  19. regiondb["Presente"] = [{value:"Monoperatore", text:"Monoperatore"},
  20.                         {value:"Coppia", text:"Coppia"},
  21.                         {value:"Formazione a tre", text:"Formazione a tre"},
  22.                         {value:"Appoggio", text:"Appoggio"},
  23.                         {value:"Fuori sede", text:"Fuori sede"},
  24.                         {value:"In sede", text:"In sede"}];
  25.  
  26.  
  27. function setCities(chooser) {
  28.     var newElem;
  29.     var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
  30.     var cityChooser = chooser.form.elements["tipo_stato_giornaliero"];
  31.     while (cityChooser.options.length) {
  32.         cityChooser.remove(0);
  33.     }
  34.     var choice = chooser.options[chooser.selectedIndex].value;
  35.     var db = regiondb[choice];
  36.     newElem = document.createElement("option");
  37.     newElem.text = "Seleziona valore";
  38.     newElem.value = "";
  39.     cityChooser.add(newElem, where);
  40.     if (choice != "") {
  41.         for (var i = 0; i < db.length; i++) {
  42.             newElem = document.createElement("option");
  43.             newElem.text = db[ i ].text;
  44.             newElem.value = db[ i ].value;
  45.             cityChooser.add(newElem, where);
  46.         }
  47.     }
  48.  
  49.  
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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <option value="Fuori Sede">Fuori Sede</option>
  3. <option value="In Sede">In Sede</option>
  4.  
I select the value Presente ( variable B ) from select Choose a Region :

2) When the variable is B in select Choose a City is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <option value="Coppia">Coppia</option>
  3. <option value="Formazione a tre">Formazione a tre</option>
  4. <option value="Appoggio">Appoggio</option>
  5. <option value="Fuori Sede">Fuori Sede</option>
  6. <option value="In Sede">In Sede</option>
  7.  
Is possible?

Regards,
Viki
Apr 3 '08 #1
72 5330
acoder
16,027 Expert Mod 8TB
Yes, it's possible.

What problems are you having with implementing it?
Apr 3 '08 #2
viki1967
263 100+
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...
Apr 3 '08 #3
acoder
16,027 Expert Mod 8TB
Use the onchange event handler to change the city drop down.
Apr 3 '08 #4
viki1967
263 100+
Use the onchange event handler to change the city drop down.
Sorry Acoder.... not understand... for example ?
Apr 3 '08 #5
acoder
16,027 Expert Mod 8TB
[HTML]<select name="region" onchange="setCities(this)">[/HTML] You may need to change the values in the array to the options that you want displayed.
Apr 3 '08 #6
viki1967
263 100+
Is already planned in this script:

Expand|Select|Wrap|Line Numbers
  1.  
  2. var regiondb = new Object()
  3. regiondb["Assente"] = [{value:"Ferie", text:"Ferie"},
  4.                       {value:"Festivitą abolita", text:"Festivitą abolita"},
  5.                       {value:"Malattia", text:"Malattia"},
  6.                       {value:"Infortunio", text:"Infortunio"},
  7.                       {value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
  8.                       {value:"Riposo Compensativo", text:"Riposo"},
  9.                       {value:"Permesso retribuito", text:"Permesso"},
  10.                       {value:"Permesso Sind./ARCA", text:"Permesso Sind"},
  11.                       {value:"Ricovero Ospedaliero", text:"Ricovero"},
  12.                       {value:"Part-time", text:"Part-time"},
  13.                       {value:"Assemblea Sindacale", text:"Assemblea"},
  14.                       {value:"Sciopero", text:"Sciopero"},
  15.                       {value:"Aspettativa", text:"Aspettativa"},
  16.                       {value:"Carica Pubblica", text:"Carica Pubblica"},
  17.                       {value:"Da giustificare", text:"Da giustificare"}];
  18.  
  19. regiondb["Presente"] = [{value:"Monoperatore", text:"Monoperatore"},
  20.                         {value:"Coppia", text:"Coppia"},
  21.                         {value:"Formazione a tre", text:"Formazione a tre"},
  22.                         {value:"Appoggio", text:"Appoggio"},
  23.                         {value:"Fuori sede", text:"Fuori sede"},
  24.                         {value:"In sede", text:"In sede"}];
  25.  
  26.  
  27. function setCities(chooser) {
  28.     var newElem;
  29.     var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
  30.     var cityChooser = chooser.form.elements["tipo_stato_giornaliero"];
  31.     while (cityChooser.options.length) {
  32.         cityChooser.remove(0);
  33.     }
  34.     var choice = chooser.options[chooser.selectedIndex].value;
  35.     var db = regiondb[choice];
  36.     newElem = document.createElement("option");
  37.     newElem.text = "Seleziona valore";
  38.     newElem.value = "";
  39.     cityChooser.add(newElem, where);
  40.     if (choice != "") {
  41.         for (var i = 0; i < db.length; i++) {
  42.             newElem = document.createElement("option");
  43.             newElem.text = db[i].text;
  44.             newElem.value = db[i].value;
  45.             cityChooser.add(newElem, where);
  46.         }
  47.     }
  48.  
  49.  
  50. ....
  51.  
  52. <select name="stato_dipendente" onchange="setCities(this)">
  53. <option>Seleziona stato giornaliero</option>
  54. <option value="Assente">Assente</option>
  55. <option value="Presente">Presente</option>
  56. </select></td>
  57.  
  58. <select name="tipo_stato_giornaliero" onchange="onChangeStatus(this);"><option>Seleziona tipo stato giornaliero</option>
  59. </select>
  60.  
  61.  
In this script implement variable A or B.
Apr 3 '08 #7
acoder
16,027 Expert Mod 8TB
Oh, I see.

You will need to create separate arrays, e.g.
Expand|Select|Wrap|Line Numbers
  1. regiondb["PresenteA"] = [{value:"Fuori sede", text:"Fuori sede"},
  2.                         {value:"In sede", text:"In sede"}];
  3. regiondb["PresenteB"] = [{value:"Monoperatore", text:"Monoperatore"},
  4.                         {value:"Coppia", text:"Coppia"},
  5.                         {value:"Formazione a tre", text:"Formazione a tre"},
  6.                         {value:"Appoggio", text:"Appoggio"},
  7.                         {value:"Fuori sede", text:"Fuori sede"},
  8.                         {value:"In sede", text:"In sede"}];
  9.  
  10.  
  11. function setCities(chooser) {
  12. ...
  13.     var choice = chooser.options[chooser.selectedIndex].value;
  14.     var db = regiondb[choice+regionVar]; // regionVar is A or B
Apr 3 '08 #8
viki1967
263 100+
Sorry... but:

Error: 'regionVar' is undefined

:(
Apr 3 '08 #9
acoder
16,027 Expert Mod 8TB
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.
Apr 3 '08 #10
viki1967
263 100+
Right, but not easy explain here...

The idea is select presente from the select name stato_dipendente :

Expand|Select|Wrap|Line Numbers
  1. <select name="stato_dipendente" onchange="setCities(this)">
  2. <option>Seleziona stato giornaliero</option>
  3. <option value="Assente">Assente</option>
  4. <option value="Presente">Presente</option>
  5. </select></td>
  6.  
When select presente in the select name stato_dipendente, sending variable as the function setCities.

The function setCities receives this variable and in the select name tipo_stato_giornaliero :

1) Variable A ===> regiondb["PresenteA"]
2) Variable B ===> regiondb["PresenteB"]

thanks for your help...
Apr 3 '08 #11
acoder
16,027 Expert Mod 8TB
That still doesn't explain when A becomes B or vice versa.

If you keep a global variable, you don't even need to pass the variable in the onchange function.
Apr 3 '08 #12
viki1967
263 100+
1) The variable is A when in select D1 is selected value DVD or value DVDR .

2) The variable is B when in select D1 is selected value CDR or value CD .



Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <select size="8" name="D1" multiple>
  4.     <option>Select</option>
  5.     <option value="A-DVD">DVD</option>
  6.     <option value="A-DVDR">DVDR</option>
  7.     <option value="B-CDR">CDR</option>
  8.     <option value="B-CD">CD</option>
  9. </select>
  10.  
  11.  
Apr 3 '08 #13
viki1967
263 100+
My page htm this:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <head>
  4.  
  5. <script language="javascript">
  6.  
  7. <!--
  8.  
  9. var regiondb = new Object()
  10. regiondb["Assente"] = [{value:"Ferie", text:"Ferie"},
  11.                       {value:"Festivitą abolita", text:"Festivitą abolita"},
  12.                       {value:"Malattia", text:"Malattia"},
  13.                       {value:"Infortunio", text:"Infortunio"},
  14.                       {value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
  15.                       {value:"Riposo Compensativo", text:"Riposo"},
  16.                       {value:"Permesso retribuito", text:"Permesso"},
  17.                       {value:"Permesso Sind./ARCA", text:"Permesso Sind"},
  18.                       {value:"Ricovero Ospedaliero", text:"Ricovero"},
  19.                       {value:"Part-time", text:"Part-time"},
  20.                       {value:"Assemblea Sindacale", text:"Assemblea"},
  21.                       {value:"Sciopero", text:"Sciopero"},
  22.                       {value:"Aspettativa", text:"Aspettativa"},
  23.                       {value:"Carica Pubblica", text:"Carica Pubblica"},
  24.                       {value:"Da giustificare", text:"Da giustificare"}];
  25.  
  26. regiondb["PresenteA"] = [{value:"Fuori sede", text:"Fuori sede"},
  27.                         {value:"In sede", text:"In sede"}];
  28.  
  29. regiondb["PresenteB"] = [{value:"Monoperatore", text:"Monoperatore"},
  30.                         {value:"Coppia", text:"Coppia"},
  31.                         {value:"Formazione a tre", text:"Formazione a tre"},
  32.                         {value:"Appoggio", text:"Appoggio"},
  33.                         {value:"Fuori sede", text:"Fuori sede"},
  34.                         {value:"In sede", text:"In sede"}];
  35.  
  36.  
  37. function setCities(chooser) 
  38.  
  39. {
  40.     var newElem;
  41.     var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
  42.     var cityChooser = chooser.form.elements["tipo_stato_giornaliero"];
  43.     while (cityChooser.options.length)
  44.  
  45.  {
  46.         cityChooser.remove(0);
  47.     }
  48.  
  49.     var choice = chooser.options[chooser.selectedIndex].value;
  50.     var db = regiondb[choice+regionVar]; // regionVar is A or B
  51.  
  52.     newElem = document.createElement("option");
  53.     newElem.text = "Seleziona valore";
  54.     newElem.value = "";
  55.     cityChooser.add(newElem, where);
  56.     if (choice != "") 
  57.  
  58.     {
  59.         for (var i = 0; i < db.length; i++) 
  60.  
  61.         {
  62.             newElem = document.createElement("option");
  63.             newElem.text = db[ i ].text;
  64.             newElem.value = db[ i ].value;
  65.             cityChooser.add(newElem, where);
  66.         }
  67.     }
  68.  
  69.  
  70.     // -->
  71.  
  72. </script>
  73.  
  74. </head>
  75.  
  76. <body>
  77.  
  78. <form method="POST" action="page.asp">
  79.  
  80. <select size="8" name="D1" multiple onChange="window.document.location='select.htm?var='+this.options[this.selectedIndex].value+'';">
  81.     <option>Select</option>
  82.     <option value="A-DVD">DVD</option>
  83.     <option value="A-DVDR">DVDR</option>
  84.     <option value="B-CDR">CDR</option>
  85.     <option value="B-CD">CD</option>
  86. </select>
  87.  
  88.  
  89. <select name="stato_dipendente" onchange="setCities(this)">
  90.     <option>Seleziona stato giornaliero</option>
  91.     <option value="Assente">Assente</option>
  92.     <option value="Presente">Presente</option>
  93. </select></td>
  94.  
  95. <select name="tipo_stato_giornaliero" onchange="onChangeStatus(this);">
  96.     <option>Seleziona tipo stato giornaliero</option>
  97. </select>
  98.  
  99. </form>
  100.  
  101. </body>
  102.  
  103. </html>
  104.  
  105.  
1) The variable is A when in select D1 is selected value DVD or value DVDR .

2) The variable is B when in select D1 is selected value CDR or value CD .

Expand|Select|Wrap|Line Numbers
  1. <select size="8" name="D1" multiple>
  2.     <option>Select</option>
  3.     <option value="A-DVD">DVD</option>
  4.     <option value="A-DVDR">DVDR</option>
  5.     <option value="B-CDR">CDR</option>
  6.     <option value="B-CD">CD</option>
  7. </select>
  8.  
The idea is select presente from the select name stato_dipendente :


Expand|Select|Wrap|Line Numbers
  1. <select name="stato_dipendente" onchange="setCities(this)">
  2. <option>Seleziona stato giornaliero</option>
  3. <option value="Assente">Assente</option>
  4. <option value="Presente">Presente</option>
  5. </select></td>
  6.  
When select presente in the select name stato_dipendente, sending variable as the function setCities.

The function setCities receives this variable and in the select name tipo_stato_giornaliero :

1) Variable A ===> regiondb["PresenteA"]
2) Variable B ===> regiondb["PresenteB"]

The error is:
Error: 'regionVar' is undefined

Link page:
http://www12.asphost4free.com/viki1967/select.htm

thanks for your help...
Apr 3 '08 #14
acoder
16,027 Expert Mod 8TB
You'll have to set regionVar to avoid the error. You could call it anything really.

Now, the select element is multiple. What if the user selects both A and B type options?

Another thing to look at is the value of the options. Can these just be "A" or "B"? If they can, then good. If not, I can show you how to get the value.

What you need to do is give the select element an id and then use document.getElementById(whatever-ID-name-you-chose) to get the element. If it's a single type select, you can just use .value to get the value. If it's a multiple, you will need to loop over to get the selected option values. Set this to regionVar (or whatever variable name you want) and you're ready to go.
Apr 3 '08 #15
viki1967
263 100+
Now, the select element is multiple. What if the user selects both A and B type options?
It's not possible; necesary control in the select name D1 only valid value A OR value B, not value A AND value B.

Can these just be "A" or "B"?
Yes only value A or value B, nothing more.

Thanks for your help.
Apr 3 '08 #16
acoder
16,027 Expert Mod 8TB
Yes only value A or value B, nothing more.
By this, I meant here:
Expand|Select|Wrap|Line Numbers
  1. <option value="A-DVD">DVD</option>
  2.     <option value="A-DVDR">DVDR</option>
  3.     <option value="B-CDR">CDR</option>
  4.     <option value="B-CD">CD</option>
could it be
Expand|Select|Wrap|Line Numbers
  1. <option value="A">DVD</option>
  2.     <option value="A">DVDR</option>
  3.     <option value="B">CDR</option>
  4.     <option value="B">CD</option>
?
Apr 3 '08 #17
viki1967
263 100+
Not, because in the page.asp do this:

Expand|Select|Wrap|Line Numbers
  1. strD1 = Split(request.form("D1"), "-")
  2.  
and insert the value Split strD1(0) and strD1(1) in the database...

It' s necessary:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <option>Select</option>
  3.     <option value="A-DVD">DVD</option>
  4.     <option value="A-DVDR">DVDR</option>
  5.     <option value="B-CDR">CDR</option>
  6.     <option value="B-CD">CD</option>
  7. </select>
  8.  
  9.  
Apr 3 '08 #18
acoder
16,027 Expert Mod 8TB
That's OK, just use the JavaScript string split() method here too.

Expand|Select|Wrap|Line Numbers
  1. regionVar = val.split("-")[0];
where val is the value of the selected option.
Apr 3 '08 #19
viki1967
263 100+
Expand|Select|Wrap|Line Numbers
  1. function setCities(chooser) 
  2.  
  3. {
  4.     var newElem;
  5.     var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
  6.     var cityChooser = chooser.form.elements["tipo_stato_giornaliero"];
  7.     while (cityChooser.options.length)
  8.  
  9.  {
  10.         cityChooser.remove(0);
  11.     }
  12.  
  13.     var regionVar = D1.split("-")[0];
  14.  
  15.     var choice = chooser.options[chooser.selectedIndex].value;
  16.     var db = regiondb[choice+regionVar]; // regionVar is A or B
  17.  
  18.     newElem = document.createElement("option");
  19.     newElem.text = "Seleziona valore";
  20.     newElem.value = "";
  21.     cityChooser.add(newElem, where);
  22.     if (choice != "") 
  23.  
  24.     {
  25.         for (var i = 0; i < db.length; i++) 
  26.  
  27.         {
  28.             newElem = document.createElement("option");
  29.             newElem.text = db[ i ].text;
  30.             newElem.value = db[ i ].value;
  31.             cityChooser.add(newElem, where);
  32.         }
  33.     }
  34.  
  35. }
The error is:
Error: 'D1' is undefined
Apr 4 '08 #20
viki1967
263 100+
[php]

<html>

<%

Session.LCID = 1040
response.expires = -1500
response.AddHeader "PRAGMA", "NO-CACHE"
response.CacheControl = "PRIVATE"

Function SELECTED(firstVal, secondVal())
For e = 0 To UBound(secondVal)
If cSTR(firstVal) = cSTR(secondVal(e)) then
SELECTED = " selected=""selected"""
End If
Next
End Function

%>

<head>

<script language="javascript">

<!--

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["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 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);
}

// regionVar
var regionVar = document.getElementById('reg').split("-")[0];

var choice = chooser.options[chooser.selectedIndex].value;
var db = regiondb[choice+regionVar]; // regionVar is A or B

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);
}
}

}

// -->

</script>

</head>

<body>

<form method="POST" action="page.asp">

<select size="8" id="reg" name="SelectMultipla" multiple="multiple">

<%

valore_strVariabile = Request.QueryString("SelectMultipla")
If len(valore_strVariabile) = 0 then

%>

<option>Select</option>
<option value="A-DVD">DVD</option>
<option value="A-DVDR">DVDR</option>
<option value="B-CDR">CDR</option>
<option value="B-CD">CD</option>

<%

Else

If InStr(valore_strVariabile,",") > 0 then
valore_strVariabile = Replace(valore_strVariabile," ","")
elementi = split(valore_strVariabile,",")
Else
elementi = array(valore_strVariabile)
End If

%>

<option>Select</option>
<option value="A-DVD" <%=SELECTED("A-DVD", elementi)%>>DVD</option>
<option value="A-DVDR" <%=SELECTED("A-DVDR", elementi)%>>DVDR</option>
<option value="B-CDR" <%=SELECTED("B-CDR", elementi)%>>CDR</option>
<option value="B-CD" <%=SELECTED("B-CD", elementi)%>>B-CDR</option>

<% End If %>

</select>


<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>

<input type="submit" value="vai" />

</form>

</body>

</html>

[/php]

Error is:

Object doens't support this property or method

:(
Apr 4 '08 #21
acoder
16,027 Expert Mod 8TB
Error is:

Object doens't support this property or method

:(
I see you got rid of the first error. This error is caused by you calling split on the actual select element rather than a string.

You need to get the selected option value and then call split on that.

To get the selected option, loop over the options of the select and get the options which are selected (options[i].selected == true).
Apr 4 '08 #22
viki1967
263 100+
I see you got rid of the first error. This error is caused by you calling split on the actual select element rather than a string.

You need to get the selected option value and then call split on that.

To get the selected option, loop over the options of the select and get the options which are selected (options[i].selected == true).
Sorry Acoder.... not understand... what include the string selected (options[i].selected == true) ?
Apr 4 '08 #23
acoder
16,027 Expert Mod 8TB
To get the selected options of a multiple select:
Expand|Select|Wrap|Line Numbers
  1. for (i=0; i < document.getElementById('reg').options.length; i++) {
  2.     if (document.getElementById('reg').options[i].selected == true) {
  3.         val = options[i].value; // you may try something else here depending on how many options can be selected...
  4.     }
  5. }
Once you have the value (which is a string), you can call split() on it.
Apr 4 '08 #24
viki1967
263 100+
Sorry, but iam not sure understand... not work...

[php]
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);
}

// regionVar

var regionVar = document.getElementById('reg').split("-")[0];

for (i=0; i < document.getElementById('reg').options.length; i++) {
if (document.getElementById('reg').options[i].selected == true) {
val = options[i].value;

}
}


var choice = chooser.options[chooser.selectedIndex].value;
var db = regiondb[choice+regionVar]; // regionVar is A or B

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);
}
}

}
[/php]
Apr 4 '08 #25
acoder
16,027 Expert Mod 8TB
You'll need to get rid of the var regionVar... line. Replace val with regionVar, e.g.
Expand|Select|Wrap|Line Numbers
  1. var regionVar = "";
  2. var reg = document.getElementById("reg");
  3. for (i=0; i < reg.options.length; i++) {
  4.     if (reg.options[i].selected == true) {
  5.         if (regionVar == "") regionVar = reg.options[i].value;
  6.     }
  7. }
Apr 4 '08 #26
viki1967
263 100+
Thanks, but change the error:

Error: 'lenght' is null or not an object

[php]
<html>

<%

Session.LCID = 1040
response.expires = -1500
response.AddHeader "PRAGMA", "NO-CACHE"
response.CacheControl = "PRIVATE"

Function SELECTED(firstVal, secondVal())
For e = 0 To UBound(secondVal)
If cSTR(firstVal) = cSTR(secondVal(e)) then
SELECTED = " selected=""selected"""
End If
Next
End Function

%>

<head>

<script language="javascript">

<!--

function onChangeStatus(dayStatusObj)
{
// Oggetto FORM
var frmObj = dayStatusObj.form;

// Se il dipendente č fuori sede o in sede, abilita 'fuori_sede' e 'Note_fuori_sede'
var flEnabled = true;
if (dayStatusObj.value == "Monoperatore") flEnabled = false;
if (dayStatusObj.value == "Coppia") flEnabled = false;
if (dayStatusObj.value == "Formazione a tre") flEnabled = false;
if (dayStatusObj.value == "Appoggio") flEnabled = false;
if (dayStatusObj.value == "Fuori sede") flEnabled = false;

}

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["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 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);
}



// regionVar

var regionVar = "";
var reg = document.getElementById("reg");
for (i=0; i < reg.options.length; i++) {
if (reg.options[i].selected == true) {
if (regionVar == "") regionVar = reg.options[i].value;
}
}

// regionVar

var choice = chooser.options[chooser.selectedIndex].value;
var db = regiondb[choice+regionVar]; // regionVar is A or B

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);
}
}

}

// -->

</script>

</head>

<body>

<form method="POST" action="page.asp">

<select size="8" id="reg" name="SelectMultipla" multiple="multiple">

<%

valore_strVariabile = Request.QueryString("SelectMultipla")
If len(valore_strVariabile) = 0 then

%>

<option>Select</option>
<option value="A-DVD">DVD</option>
<option value="A-DVDR">DVDR</option>
<option value="B-CDR">CDR</option>
<option value="B-CD">CD</option>

<%

Else

If InStr(valore_strVariabile,",") > 0 then
valore_strVariabile = Replace(valore_strVariabile," ","")
elementi = split(valore_strVariabile,",")
Else
elementi = array(valore_strVariabile)
End If

%>

<option>Select</option>
<option value="A-DVD" <%=SELECTED("A-DVD", elementi)%>>DVD</option>
<option value="A-DVDR" <%=SELECTED("A-DVDR", elementi)%>>DVDR</option>
<option value="B-CDR" <%=SELECTED("B-CDR", elementi)%>>CDR</option>
<option value="B-CD" <%=SELECTED("B-CD", elementi)%>>B-CDR</option>

<% End If %>

</select>


<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">
<option>Seleziona tipo stato giornaliero</option>
</select>

<input type="submit" value="vai" />

</form>

</body>

</html>
[/php]
Apr 4 '08 #27
acoder
16,027 Expert Mod 8TB
Heh, you checked too soon! I've changed my post- have a look.
Apr 4 '08 #28
viki1967
263 100+
Heh, you checked too soon! I've changed my post- have a look.
OK;

Thanks, but change the error:

Error: 'lenght' is null or not an object
Apr 4 '08 #29
acoder
16,027 Expert Mod 8TB
lenght should be spelt length. Find the line with the error and correct it.
Apr 4 '08 #30
viki1967
263 100+
lenght should be spelt length. Find the line with the error and correct it.

Ok, this is:

[php]
// regionVar
var regionVar = "";
var reg = document.getElementById("reg");
for (i=0; i < reg.options.length; i++) {
if (reg.options[i].selected == true) {
if (regionVar == "") regionVar = reg.options[i].value;
}
}
// regionVar

var choice = chooser.options[chooser.selectedIndex].value;
var db = regiondb[choice+regionVar]; // regionVar is A or B

newElem = document.createElement("option");
newElem.text = "Seleziona valore";
newElem.value = "";
cityChooser.add(newElem, where);
if (choice != "")

{
for (var i = 0; i < db.length; i++) <==== ERROR LENGHT

{
newElem = document.createElement("option");
newElem.text = db[i].text;
newElem.value = db[i].value;
cityChooser.add(newElem, where);
}
}
[/php]
Apr 4 '08 #31
viki1967
263 100+
Try this page, please:

http://www.complessobandisticopalomb...967/select.asp
Apr 4 '08 #32
acoder
16,027 Expert Mod 8TB
Sorry, forgot about the splitting:
Expand|Select|Wrap|Line Numbers
  1. // regionVar   
  2. var regionVar = "";
  3. var reg = document.getElementById("reg");
  4. for (i=0; i < reg.options.length; i++) {
  5.     if (reg.options[i].selected) {
  6.         regionVar = reg.options[i].value.split("-")[0];
  7.         break;
  8.     }
  9. }
  10. // regionVar
Added a break to break out of the loop once selected option found.
Apr 4 '08 #33
acoder
16,027 Expert Mod 8TB
This length error is most likely caused by db not being defined because you didn't choose an option or you chose the default option (not Assente/Presente) :
Expand|Select|Wrap|Line Numbers
  1.     var choice = chooser.options[chooser.selectedIndex].value;
  2.     var db = regiondb[choice+regionVar]; // regionVar is A or B
  3.  
  4.     newElem = document.createElement("option");
  5.     newElem.text = "Seleziona valore";
  6.     newElem.value = "";
  7.     cityChooser.add(newElem, where);
  8.     if (choice != "" && regionVar != "") 
  9.  
  10.  
Apr 4 '08 #34
viki1967
263 100+
The problem is when select value Assente in the select name="stato_dipendente"...

http://www.complessobandisticopalomb...967/select.asp

Apr 4 '08 #35
viki1967
263 100+
This solution, but it is right? :

Expand|Select|Wrap|Line Numbers
  1.  
  2. var regiondb = new Object()
  3. regiondb["AssenteA"] = [{value:"Ferie", text:"Ferie"},
  4.                       {value:"Festivitą abolita", text:"Festivitą abolita"},
  5.                       {value:"Malattia", text:"Malattia"},
  6.                       {value:"Infortunio", text:"Infortunio"},
  7.                       {value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
  8.                       {value:"Riposo Compensativo", text:"Riposo"},
  9.                       {value:"Permesso retribuito", text:"Permesso"},
  10.                       {value:"Permesso Sind./ARCA", text:"Permesso Sind"},
  11.                       {value:"Ricovero Ospedaliero", text:"Ricovero"},
  12.                       {value:"Part-time", text:"Part-time"},
  13.                       {value:"Assemblea Sindacale", text:"Assemblea"},
  14.                       {value:"Sciopero", text:"Sciopero"},
  15.                       {value:"Aspettativa", text:"Aspettativa"},
  16.                       {value:"Carica Pubblica", text:"Carica Pubblica"},
  17.                       {value:"Da giustificare", text:"Da giustificare"}];
  18.  
  19. regiondb["AssenteB"] = [{value:"Ferie", text:"Ferie"},
  20.                       {value:"Festivitą abolita", text:"Festivitą abolita"},
  21.                       {value:"Malattia", text:"Malattia"},
  22.                       {value:"Infortunio", text:"Infortunio"},
  23.                       {value:"Riposo Fisiologico", text:"Riposo Fisiologico"},
  24.                       {value:"Riposo Compensativo", text:"Riposo"},
  25.                       {value:"Permesso retribuito", text:"Permesso"},
  26.                       {value:"Permesso Sind./ARCA", text:"Permesso Sind"},
  27.                       {value:"Ricovero Ospedaliero", text:"Ricovero"},
  28.                       {value:"Part-time", text:"Part-time"},
  29.                       {value:"Assemblea Sindacale", text:"Assemblea"},
  30.                       {value:"Sciopero", text:"Sciopero"},
  31.                       {value:"Aspettativa", text:"Aspettativa"},
  32.                       {value:"Carica Pubblica", text:"Carica Pubblica"},
  33.                       {value:"Da giustificare", text:"Da giustificare"}];                      
  34.  
  35. regiondb["PresenteA"] = [{value:"Fuori sede", text:"Fuori sede"},
  36.                         {value:"In sede", text:"In sede"}];
  37.  
  38. regiondb["PresenteB"] = [{value:"Monoperatore", text:"Monoperatore"},
  39.                         {value:"Coppia", text:"Coppia"},
  40.                         {value:"Formazione a tre", text:"Formazione a tre"},
  41.                         {value:"Appoggio", text:"Appoggio"},
  42.                         {value:"Fuori sede", text:"Fuori sede"},
  43.                         {value:"In sede", text:"In sede"}];
  44.  
  45.  
Apr 4 '08 #36
acoder
16,027 Expert Mod 8TB
So this variable A or B is only for Presente?

You could keep it like your previous post if in future you plan to add A/B options for Assente too. If not, add some code to check the choice is not "Assente" when adding regionVar, i.e. the line
Expand|Select|Wrap|Line Numbers
  1. var db = regiondb[choice+regionVar]; // regionVar is A or B
should only be for "Presente". If choice is "Assente", don't add regionVar:
Expand|Select|Wrap|Line Numbers
  1. if (choice == "Presente") choice += regionVar;
  2. var db = regiondb[choice];
Apr 4 '08 #37
viki1967
263 100+
Thanks.

Yes, this variable A or B is only for value Presente

With last changes when Assente displays alert('db empty').

[php]
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);
}



// regionVar
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;
}
}
// regionVar

var choice = chooser.options[chooser.selectedIndex].value;

if (choice == "Presente") choice += regionVar;
var db = regiondb[choice];

//var db = regiondb[choice+regionVar]; // regionVar is A or B

if(typeof(db) == 'undefined') {
alert('db empty');
return;
}

newElem = document.createElement("option");
newElem.text = "Seleziona valore";
newElem.value = "";
cityChooser.add(newElem, where);
if (choice != "" && regionVar != "")

{
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);
}
}

}
[/php]
Apr 4 '08 #38
viki1967
263 100+
Thanks.

Yes, this variable A or B is only for value Presente

With last changes when Assente displays alert('db empty').

http://www.complessobandisticopalomb...967/select.asp
Apr 4 '08 #39
acoder
16,027 Expert Mod 8TB
Change regiondb["AssenteA"] back to regiondb["Assente"].
Apr 4 '08 #40
viki1967
263 100+
Change regiondb["AssenteA"] back to regiondb["Assente"].
Many, many thanks Acoder....

http://www.complessobandisticopalomb...967/select.asp
Apr 4 '08 #41
acoder
16,027 Expert Mod 8TB
You're welcome. Phew! One long thread this one.
Apr 4 '08 #42
viki1967
263 100+
You're welcome. Phew! One long thread this one.
Yes, long thread but very interesting....
Apr 4 '08 #43
viki1967
263 100+
Hi, i have new problem..

Please follow this sequence in this page web:

http://www.complessobandisticopalomb...967/select.asp

1) No selection in the select name="SelectMultipla";
2) Select value Assente in the select name="stato_dipendente";
3) The select name="tipo_stato_giornaliero" is empty.

1) No selection in the select name="SelectMultipla";
2) Select value Presente in the select name="stato_dipendente";
3) The alert window warning db empty.

You can see alert window warning when value Assente is selected in the select name="stato_dipendente" ???

Thanks...
Apr 7 '08 #44
acoder
16,027 Expert Mod 8TB
Lol, you're back!

That seems easy enough to solve. Just add an entry for "Presente" (maybe something empty) in the regiondb array.
Apr 7 '08 #45
viki1967
263 100+
Thanks, !

Sorry, but iam not understand...

I modify this code:?

Expand|Select|Wrap|Line Numbers
  1.     if(typeof(db) == 'undefined') {
  2.        alert('db empty');
  3.     return;
  4.  
...

[php]
<html>

<head>

<script language="javascript">

<!--

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["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 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 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(typeof(db) == 'undefined') {
alert('db empty');
return;
}

newElem = document.createElement("option");
newElem.text = "Seleziona valore";
newElem.value = "";
cityChooser.add(newElem, where);
if (choice != "" && regionVar != "")

{
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);
}
}

}

// -->

</script>

</head>

<body>

<form method="POST" action="page.asp">

<select size="8" id="reg" name="SelectMultipla" multiple="multiple">



<option>Select</option>
<option value="A-DVD">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">Presente</option>
</select></td>

<select name="tipo_stato_giornaliero">
<option>Seleziona tipo stato giornaliero</option>
</select>

<input type="submit" value="vai" />

</form>

</body>

</html>
[/php]
Apr 7 '08 #46
acoder
16,027 Expert Mod 8TB
Add:
Expand|Select|Wrap|Line Numbers
  1. regiondb["Presente"] = [];
Apr 8 '08 #47
viki1967
263 100+
Add:
Expand|Select|Wrap|Line Numbers
  1. regiondb["Presente"] = [];
Thanks Acoder, but not change....

[php]
<html>


<head>

<script language="javascript">

<!--

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["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"}];

regiondb["PresenteA"] = [];
regiondb["PresenteB"] = [];

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 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(typeof(db) == 'undefined') {
alert('db empty');
return;
}

newElem = document.createElement("option");
newElem.text = "Seleziona valore";
newElem.value = "";
cityChooser.add(newElem, where);
if (choice != "" && regionVar != "")

{
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);
}
}

}

// -->

</script>

</head>

<body>

<form method="POST" action="page.asp">

<select size="8" id="reg" name="SelectMultipla" multiple="multiple">



<option>Select</option>
<option value="A-DVD">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">Presente</option>
</select></td>

<select name="tipo_stato_giornaliero">
<option>Seleziona tipo stato giornaliero</option>
</select>

<input type="submit" value="vai" />

</form>

</body>

</html>
[/php]
Apr 8 '08 #48
acoder
16,027 Expert Mod 8TB
You've rewritten PresenteA/B with these two lines:
Expand|Select|Wrap|Line Numbers
  1. regiondb["PresenteA"] = [];
  2. regiondb["PresenteB"] = [];
Replace them with:
Expand|Select|Wrap|Line Numbers
  1. regiondb["Presente"] = [];
Apr 8 '08 #49
viki1967
263 100+
You've rewritten PresenteA/B with these two lines:
Expand|Select|Wrap|Line Numbers
  1. regiondb["PresenteA"] = [];
  2. regiondb["PresenteB"] = [];
Replace them with:
Expand|Select|Wrap|Line Numbers
  1. regiondb["Presente"] = [];
Thanks Acoder, but i not explain...

If select value Presente in the select name="stato_dipendente" I see :

Expand|Select|Wrap|Line Numbers
  1.     if(typeof(db) == 'undefined') {
  2.        alert('db empty');
  3.     return;
  4.  

If select value Assente in the select name="stato_dipendente" I NOT see :

Expand|Select|Wrap|Line Numbers
  1.     if(typeof(db) == 'undefined') {
  2.        alert('db empty');
  3.     return;
  4.  
The window alert it necessary for two cases....
Apr 8 '08 #50

Sign in to post your reply or Sign up for a free account.

Similar topics

18
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...
1
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...
9
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...
0
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...
7
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....
2
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...
9
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...
2
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.