change the button text on dropdownlist value

Posted by Chaithragm under JavaScript on 4/24/2014 | Points: 10 | Views : 453 | Status : [Member] | Replies : 1
i have used this java script function ,im getting the value but button text is not changing ,how to change the button text?

<script type="text/javascript">
function GetPaymentDetails(value) {
// alert(value);
// var parm = document.getElementById("ddPaymentMode");
// var value = parm.options[parm.selectedIndex].value;

if (value == 18) {

btnSubmit.Text = "Register&Pay";
ModalPopupExtender1.Show();
}
else {
btnSubmit.Text = "Register";
ModalPopupExtender1.Show();
}
}
</script>

////////dropdownlist

<asp:DropDownList ID="ddPaymentMode" onchange="GetPaymentDetails(this.value)"
runat="server" >
</asp:DropDownList>
///////submit button
<asp:Button ID="btnSubmit" runat="server" Text="Register &raquo;" CssClass="button"
OnClientClick="return validategi();" OnClick="btnSubmit_Click" />




Responses

Posted by: Vuyiswamb on: 4/24/2014 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
use the following

document.getElementById("<%= btnSubmit.ClientID %>").value = "some text";


Thank you for posting at Dotnetfunda
[Administrator]

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response