1. How to get the Text of combobox in clientside javascript
===========================================================
Aspx Page Code
===============
<dx :ASPxComboBox ID="cmbExample1" ClientInstanceName="cmbExample" runat="server">
</dx: ASPxComboBox>
<asp:button Id="btnTest" Text="Show Text" OnClientClick="ShowComboText(); return false;" runat="server" >
Note: here "cmbExample" is the clientinstance name of the combobox control.
Javascript:
===========
{
var comboText= cmbExample.GetText();
alert(comboText);
}
2. How to get the value of the combobox in clientside javascript
================================================================
Note: here "cmbExample" is the clientinstance name of the combobox control.
Javascript:
===========
{
var comboval= cmbExample.GetValue();
alert(comboval);
}
3. How to find the item from combobox in clientside javascript
================================================================
Note: here "cmbExample" is the clientinstance name of the combobox control.
Javascript:
===========
{
var comboitem= cmbExample.FindItemByValue('your value');
alert(comboitem);
}
function ShowFoundedItemByText()
{
var comboitem= cmbExample.FindItemByText('your value');
alert(comboitem);
}
4. How to remove from combobox in clientside javascript
================================================================
Note: here "cmbExample" is the clientinstance name of the combobox control.
Javascript:
===========
{
var comboitem= cmbExample.FindItemByValue('your value');
if (comboitem != undefined && comboitem != null)
{
}
}
Thank you so much :)))
ReplyDelete