Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Actually i want to display the send button after selecting the value in combobox is it possible
Posted

1 solution

Hello,

For RadCombobox you do it following way.
HTML
<script language="javascript" type="text/javascript">
    function OnClientSelectedIndexChanged(sender, eventArgs) {
        var item = eventArgs.get_item();
        if (item.get_text() === "SOME VALUE") {
            var btn = document.getElementById("YOUR BUTTON ID");
            btn.className = 'show_button';
        }
    }
</script>

<telerik:radcombobox 
    id="RadComboBox1" 
    runat="server" 
    onclientselectedindexchanged="OnClientSelectedIndexChanged">
</telerik:radcombobox>l;

Your button will be initially hidden. This can be easily achieved by applying a CSS rule. When user selects a value you then apply a new CSS Rule which makes it visible. Following samples shows the CSS rules.
HTML
<style type="text/css">
.hidden_button { visibility: hidden; }
.show_button { visibility: visible; }
</style>

Regards,
 
Share this answer
 
v2
Comments
ntitish 1-Jul-13 9:02am    
My rad combobox

<telerik:RadComboBox ID="cmbUsers" runat="server"
Width="75%" Filter="Contains"
Font-Size="14pt"
EmptyMessage="Search for contact..." OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">

<itemtemplate>

<asp:Label ID="lbluser" runat="server" Text='<%# Eval("UserName") %>' Font-Size="Large" >


SendButton


<asp:Button ID="btnsend" TabIndex="3" runat="server"
Text="Send" CssClass="da-button blue" Visible="false" Height="32px" Font-Bold="true"
Font-Size="12pt" Width="65px" onclick="btnsendclick" />
Prasad Khandekar 1-Jul-13 9:10am    
Hello Nitish,

Please Check the updated solution.

Regards,
ntitish 1-Jul-13 9:28am    
After modifying i writen my code like below but it is not executing

.hidden_button { visibility: hidden; }
.show_button { visibility: visible; }

function OnClientSelectedIndexChanged(sender, eventArgs) {
var item = eventArgs.get_item();
if (item.get_text() === "") {
var btn = document.getElementById("btnSearch");
btn.className = 'show_button';
}


<telerik:RadComboBox ID="cmbUsers" runat="server"
Width="75%" Filter="Contains"
Font-Size="14pt"
EmptyMessage="Search for contact..." OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">

<itemtemplate>

<asp:Label ID="lbluser" runat="server" Text='<%# Eval("UserName") %>' Font-Size="Large" >






<asp:Button ID="btnSearch" TabIndex="3" runat="server"
Text="Send" CssClass="hidden_button" Height="32px" Font-Bold="true"
Font-Size="12pt" Width="65px" onclick="btnSearch_Click" />
Prasad Khandekar 1-Jul-13 9:32am    
What's happening?
ntitish 1-Jul-13 23:46pm    
No change sir,by default it is in hide position but when i select any item in the combobox it should display the button but it is not displaying i had a dought in this line

if (item.get_text() === "SOME VALUE")

instead of "SOME VALUE" what should i pass.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900