Rama Giri

Rama Giri

87 Articles Published

Articles by Rama Giri

Page 5 of 9

Count rows having three or more rows with a certain value in a MySQL table

Rama Giri
Rama Giri
Updated on 30-Jul-2019 167 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> UserId int    -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(30); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.09 sec) ...

Read More

HTML DOM Input Checkbox disabled Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 1K+ Views

The HTML DOM Input Checkbox disabled property sets/returns whether Input Checkbox is to be enabled or disabled.SyntaxFollowing is the syntax −Returning boolean value − true/falseinputCheckboxObject.disabledSetting disabled to booleanValueinputCheckboxObject.disabled = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the checkbox is disabled.falseIt defines that the checkbox is not disabled and it is also the default value.ExampleLet us see an example of Input Checkbox disabled property − Live Demo Student Details Biology: Mathematics: Physics: Psychology: Enable Subjects    function enableCheckboxes(){       var enableCheckboxes ...

Read More

HTML DOM Input Checkbox required Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 431 Views

The Input Checkbox required property determines whether Input Checkbox is compulsory to check or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputCheckboxObject.requiredSetting required to booleanValueinputCheckboxObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that it is compulsory to check the checkbox to submit form.falseIt is the default value and checking is not compulsory.ExampleLet us see an example of Input Checkbox required property − Live Demo Required Attribute of Checkbox Check me ! I am required: Check if form is submittable    function getRequiredStatus(){       var requiredBool ...

Read More

HTML DOM Input Color defaultValue Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 192 Views

The HTML DOM Input Color defaultValue property sets/returns the default value corresponding to a color. It may or may not be same as value attribute.SyntaxFollowing is the syntax −Returning string valueinputColorObject.defaultValueSetting defaultValue to stringinputColorObject.defaultValue = ‘string’Boolean ValueHere, “string” can be the following −booleanValueDetails#000000 - #ffffffIt defines that input color can have a default value between the defined rangeExampleLet us see an example of Input Color defaultValue property − Live Demo Input Color Default Value Color Picker: Get Default Value    var divDisplay = document.getElementById("divDisplay");    var inputColor = document.getElementById("Color");    function getDefaultValue() { ...

Read More

HTML DOM Input Color form Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 140 Views

The Input Color form property returns the reference of enclosing form for input color.SyntaxFollowing is the syntax −Returning reference to the form objectinputColorObject.formExampleLet us see an example of Input Color form property − Live Demo Input Color Form Color Picker:  Get Form ID    function getFormID() {       var inputColor = document.getElementById("Color");       var divDisplay = document.getElementById("divDisplay");       divDisplay.textContent = 'Form ID for color input: '+inputColor.form.id;    } OutputThis will produce the following output −Before clicking ‘Get Form ID’ button −After clicking ‘Get Form ID’ button −

Read More

HTML DOM Input Color Object

Rama Giri
Rama Giri
Updated on 30-Jul-2019 196 Views

The HTML DOM Input Color Object represents an input HTML element with type color.SyntaxFollowing is the syntax −Creating an with type color −var colorObject = document.createElement(“input”); colorObject.type = “color”;AttributesHere, “colorObject” can have the following attributes −AttributesDescriptionautocompleteIt defines the value of autocomplete attribute of a color pickerautofocusIt defines if the color picker should be focused on initial page load.defaultValueIt sets/returns the default value of color pickerdisabledIt defines if color picker is disabled/enabledformIt returns a reference of enclosing form that contains the color pickernameIt defines the value of name attribute of a color pickertypeIt returns the type of form element of ...

Read More

HTML DOM Input Color value Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 147 Views

The HTML DOM Input Color value property returns a string, which represents the value of the input color value attribute. User can also set it to a new string.SyntaxFollowing is the syntax −Returning string valueinputColorObject.valueSetting value attribute to a string valueinputColorObject.value = ‘String’ExampleLet us see an example of Input Color value property − Live Demo Input Color Value Primary-Color: Get type & change to text    var inputColor = document.getElementById("Color");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'value: '+inputColor.value;    function changeValue() {       if(inputColor.value == '#00ff00'){       ...

Read More

HTML DOM Input Date disabled Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 178 Views

The HTML DOM Input Date disabled property sets/returns whether Input Date is enabled or disabled.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDateObject.disabledSetting disabled to booleanValueinputDateObject.disabled = booleanValueBoolean ValueHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input date is disabled.falseIt defines that the input date is not disabled and it is also the default value.ExampleLet us see an example of Input Date disabled property − Live Demo Input Date Disabled Date Select: Enable Date Input    var divDisplay = document.getElementById("divDisplay");    var inputDate = document.getElementById("dateSelect");    divDisplay.textContent = 'Date Input disabled: ...

Read More

HTML DOM Input Date name Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 161 Views

The HTML DOM Input Date name property returns a string, which is the name attribute of input date. User can also set it to a new string.SyntaxFollowing is the syntax −Returning string valueinputDateObject.nameSetting name attribute to a string valueinputDateObject.name = ‘String’ExampleLet us see an example of Input Date name property − Live Demo Input Date Name Date Select: Change name value    var inputDate = document.getElementById("date");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'Name of date input: '+inputDate.name;    function changeNameValue() {       if(inputDate.name == 'Monday'){         ...

Read More

Adding a new column with the current time as a default value in MySQL?

Rama Giri
Rama Giri
Updated on 30-Jul-2019 502 Views

For this, you can use the DEFAULT CURRENT_TIMESTAMP clause in MySQL. Following is the syntax −CREATE TABLE yourTableName (    yourColumnName1 dataType1,    yourColumnName timestamp DEFAULT CURRENT_TIMESTAMP );Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> DueDate timestamp default current_timestamp    -> ); Query OK, 0 rows affected (0.86 sec)Now you can insert some records in the table using insert command −mysql> insert into DemoTable values(); Query OK, 1 row affected (0.16 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+----+---------------------+ ...

Read More
Showing 41–50 of 87 articles
« Prev 1 3 4 5 6 7 9 Next »
Advertisements