Wenn ich ein Element aus DropDownList
wähle, möchte ich eine TexBox
verschwinden und durch eine andere in der gleichen genauen Position ersetzt werden.Ersetzen Sie eine TextBox basierend auf DropDownList Auswahl
Zum Beispiel: Ich habe eine DropDownList
mit Kategorien von SI Ausrüstungen gefüllt, Laptop, Desktop, Display etc. Also, wenn ich wählen Sie Anzeigen, die RAM, CPU, area per Festplatte muss verschwinden und INCH TextBox
sollte RAM TextBox ersetzen.
Dies ist mein Code:
<div>
<label id="l1" class="label" >Numéro de série:</label>
<asp:TextBox ID="NumSerie" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l8" class="label"> Systeme d'exploitation: </label>
<asp:TextBox ID="SystemEx" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button class="NButton" ID="Button1" runat="server" Height="38px" Text="Ajouter" Width="140px" OnClick="Button1_Click" />
</div>
<div>
<label id="l2" class="label">Désignation:</label>
<asp:TextBox ID="Designation" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l9" class="label"> Processeur:</label>
<asp:TextBox ID="Cpu" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button CssClass="NButton" ID="Button2" runat="server" Height="38px" Text="Modifier" Width="140px" />
</div>
<div>
<label id="l3" class="label">
<asp:TextBox ID="Marque" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l10" class="label">Ram: </label>
<asp:TextBox ID="Ram" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button CssClass="NButton" ID="Button3" runat="server" Height="38px" Text="Supprimer" Width="140px" />
</div>
<div>
<label id="l4" class="label">
<br />
Catégorie:</label>
<asp:DropDownList ID="IdCategorie" CssClass="textbox" runat="server" Height="32px" Width="200px"/>
<label id="l11" class="label"> Capacité destockage:</label>
<asp:TextBox ID="CapaciteSt" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button CssClass="NButton" ID="Button4" runat="server" Height="38px" Text="Rechercher" Width="140px" />
</div>
<div>
<label id="l5" class="label">
<br />
Code de fournisseur:</label>
<asp:DropDownList ID="CodeFour" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l12" class="label"></label>
<asp:TextBox ID="Remise" class="textbox" runat="server" Height="32px" Width="200px" />
<asp:Label ID="l15" runat="server" CssClass="label" Text="ID Equi:"></asp:Label>
<asp:TextBox CssClass="Rtextbox" ID="TextBox1" runat="server" Height="22px" Width="70px"></asp:TextBox>
</div>
<div>
<label id="l6" class="label"></label>
<asp:TextBox ID="Prix" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l13" class="label">Modele </label>
<asp:TextBox Id="Modele" CssClass="textbox" runat="server" Height="32px" Width="200px" />
</div>
<div>
<label id="l7" class="label"> </label>
<asp:TextBox ID="EtatGarantie" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l14" class="label"></label>
<asp:TextBox ID="Pouces" CssClass="textbox" runat="server" Height="32px" Width="200px" />
</div>
<asp:Button CssClass="NButton" ID="Button5" runat="server" Text="<<" Width="55px" />
Alter, ernsthaft? Bitte formatieren Sie Ihren Code, das ist lächerlich ... Brauchen Sie Hilfe? Lesen Sie hierzu: [Hilfe bearbeiten] (http://stackoverflow.com/editing-help) –
Sie können Textbox Sichtbarkeitsattribut auf false auf Dropdown-Liste ausgewählter Index geändert verwenden. Oder, da Sie div-Tag haben, können Sie 'display: none' css style verwenden. –
Sorry Leute, es ist mein erstes Mal hier im Forum. –