Posts

Showing posts from August, 2025

how to dynamically bind Year in DropDownList using JavaScript

Image
Introduction: Hello Guys, “ Welcome back” Today i am here with another one new great article. In this article I will explain about how to dynamically bind or populate Year in DropDownList i.e. HTML SELECT element using JavaScript. Inside the window.onload event handler, the DropDownList i.e. HTML SELECT element will be referenced and using a For Loop, one by one Year values will be appended to the DropDownList using JavaScript. Code for HTML page On the   HTML page I place a   DropDownList i.e. HTML SELECT element. < select id ="ddlYears"></ select >     Dynamically populating Year in DropDownList (SELECT) using JavaScript On the window.onload event handler of the page, first the DropDownList i.e. HTML SELECT element is referenced and then the Current Year will be find using JavaScript Date object. Then using a For Loop, one by one Year values will be increasing or appended to the DropDownList by creating a dynamic OPTION element...

Enable TextBox if other option is selected in DropDownlist using JavaScript and jQuery

Introduction: Hello Guys, “ Welcome back” Today i am here with another one new great article. In this article I will explain about how to activate or enable the TextBox if other option is selected by the user from DropDownlist using JavaScript and jQuery. When user will select Other (option) from the DropDownList is selected, the TextBox will be enabled else disabled. Activate TextBox if another option is selected in DropDownBox using JavaScript On the HTML page I will place DropDownList by using (HTML SELECT Tag) and a TextBox. To the DropDownList I will assign a JavaScript OnChange event handler. When user will select the item (option) from the dropdownlist, then the EnableDisableTextBox JavaScript function will be executed. Inside this function, based on whether the Other option (item) is selected, the TextBox will be enabled else disabled. < script type ="text/javascript">     function EnableDisableTextBox(ddlModels) {     ...