Posts

Showing posts from December, 2012

Creating Dynamic Controls in JavaScript

Creating dynamic controls in javascript will provide us a great feature for our websites that too will give a flexible data entry pages.  For creating controls dynamically in javascript we can follow some basic rules like - Createing a method for creating a particular control.  We can use this method for creating that particular control in our whole project. Creating controls in javascript can be done by using "document.createElement()" method by passing tag name as parameter as follows for example if we want to create a textbox or some input fields, then the code will be as follows var  textBox = document.createElement( 'input' ); then by adding setAttribute method for that control we can set various attributes for that control. Here the code for this Creating TextBox i.e., input text field: function CreateTextBox(id, value) {     var textBox = document.createElement( 'input' );     textBox.setAttribute( "type" , "text&