Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ended up using the pure html select control and save both values in two hiddenFields. With this i can preserve the enableeventvalidation with the default value that is true :)</p> <p>Here some of the code:</p> <pre><code>&lt;select CssClass="textoLightbox" id="selectPais" onchange="cambiarCiudad()"&gt;&lt;/select&gt; &lt;asp:HiddenField runat="server" ID="hdnPaisSeleccionado" /&gt; &lt;select CssClass="textoLightbox" id="selectCiudad" onchange="guardarCiudad()"&gt;&lt;/select&gt; &lt;asp:HiddenField runat="server" ID="hdnCiudadSeleccionada" /&gt; &lt;script language="javascript" type="text/javascript"&gt; $(document).ready(function () { ImprimirPais("selectPais"); var dropPais = document.getElementById("selectPais"); var dropCiudad = document.getElementById("selectCiudad"); dropPais.value = "USA"; print_state('selectCiudad', dropPais.selectedIndex) dropCiudad.value = "California"; document.getElementById("&lt;%=hdnPaisSeleccionado.ClientID%&gt;").value = "USA"; document.getElementById("&lt;%=hdnCiudadSeleccionada.ClientID%&gt;").value = "California"; }); //Repopula el combo de las ciudades cuando es cambiado el pais. function cambiarCiudad() { var dropPais = document.getElementById("selectPais"); //Vacia ciudad document.getElementById('selectCiudad').options.length = 0; //Repopula ciudad de acuerdo al pais print_state('selectCiudad', dropPais.selectedIndex); //Guarda Pais document.getElementById("&lt;%=hdnPaisSeleccionado.ClientID%&gt;").value = dropPais.value; //Guarda Ciudad guardarCiudad(); } function guardarCiudad() { var dropCiudad = document.getElementById("selectCiudad"); document.getElementById("&lt;%=hdnCiudadSeleccionada.ClientID%&gt;").value = dropCiudad.value; } </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload