Posts

Showing posts from February, 2018

Add and Drop New not null column in Sql

In this lesson we are going to see how to add new column with default value.This situation arrives sometimes  we need to add a field in primary key or some others.So here i will explain it. 1.Add Column ALTER TABLE  table name ADD column name  datatype DEFAULT  default value NOT NULL (e.g) alter table customer add   customer_type tinyint default 1 not null alter table  test  add  age int  not null   default  1 2.Drop column  ALTER TABLE  table name  ALTER COLUMN  column name  datatype  NULL (e.g) alter table  customer  alter column  customer_type tinyint  null I hope this will be helpful for you.

How to bind checkbox using Jquery?

We often use checkbox and radio button.It gives very good feel for users.It does some wonderful jobs.So here we can see how to bind the checkbox using jquery.I have given the ways of binding or checking checkboxes  below.You can use either of this way as per your need. Jquery 1.Based on the the Name of the checkbox $('input[type=checkbox][name=test]').prop('checked', true); 2.Based on the Id of the checkbox $('#test').prop('checked', true); 3.Based on the Class of the checkbox $('.check').prop('checked', true); HTML  <input type="checkbox" name="test"  id="test" class="check"/> Here I have a working example. https://jsfiddle.net/Abeyram/pxqfbf17/18/

Jquery Data table Destroying and Recreation

Today i have come up with the very useful technique for the people who are using jquery datatable. In our case we have a html table ,we are going to change it as jquery datatable.Because jquery data table has lot of options like filtering,exporting and so on.This is the very daunting task most of the time .So here i have a method to do this operation.I checked this.It works fine. Necessary scripts  <script src="~/Datatable/script/jquery.dataTables.min.js"></script>     <script src="~/Datatable/script/dataTables.buttons.min.js"></script>     <script src="~/Datatable/script/jszip.min.js"></script>     <script src="~/Datatable/script/pdfmake.min.js"></script>     <script src="~/Datatable/script/vfs_fonts.js"></script>     <script src="~/Datatable/script/buttons.html5.min.js"></script>     <script src="~/Datatable/script/buttons.print.min....

Search html table contents based on its td using Jquery

In this session we are going to see about searching the specific text in the html table.This is very useful most of the times rather bind data each time while searching.So here i have one textbox and one html table .In our case we have to display the input text from the table if exists.So here we go Jquery var findtext =$('#txtsearch').val(); if($.trim(findtext)!=' ') { $("#tbltext tbody tr").hide(); $('#tbltext tbody tr').each(function () { if ($.trim($(this).find('td').eq(1).text()) == $.trim(findtext)) { $(this).show(); } }); } else { $("#tbltext tbody tr").show(); } HTML <input type='text' id ='txtsearch'> </br> <table id='tbltext' > <thead> <tr> <th>No.</th><th>Name</th><th>Age</th> </tr> </thead> <tbody> <tr><td>1</td><td>Hello</td><td>10</td...

Autocomplete text box using Jquery

In this session,i'm going to explain about Autocomplete Textbox using Jquery.We may have met lot of situations for provide suggestions to users while they are typing .It will be more helpful for them to identify the datas easily.Time will be reduced by this.we can accomplish  this  through Lot of jquery plugins .Here i have used one jquery plugin with the link https://www.jqueryscript.net/form/Autocomplete-Dropdown-List-Plugin-jQuery.html This plugin must be included before proceed the below code.So now we can see how to make autocomplete textbox by using this plugin. In my case i have use one html select control for express this plugin feature.Here i have loaded dynamic data and static as well. 1.Dynamic data Jquery $.ajax({ type: 'post', url: 'type your url', data: {parameters}, dataType: 'json', success: function (data) { if (data.length != 0) {                         ...

Display data on mouse pointer using Jquery

Displaying data dynamically on the mouse pointer is tedious task.we often meet this situation.So in this session we may see about it. HTML <div id="test">   You are hovered...<br/> </div> <div class='container'> <h2> Hello saran! </h2> </div> Jquery $('#test').hide(); $('.container').on('mouseenter', function(e) {     e.preventDefault();     $('#test').css( 'position', 'absolute' );     $('#test').css( 'top', e.pageY );     $('#test').css( 'left', e.pageX );     $('#test').show(); }); $('.container').on('mouseleave', function(e) {     e.preventDefault();        $('#test').hide(); }); I have two divs.I hide one div(test) in the beginning .Later i will display it when we mouse over the second div. Here i have used class selector to identify div...

Checkbox using Jquery

Check boxes are often used in websites.They provide selection related assist in websites.So in this lesson we may see checkbox  changed events using jquery.We can find controls by using selectors such as ID selector,CLASS selector. HTML <input type='checkbox' name ='test' Id='check'  /> Jquery $('input:checkbox[name=test]').change(function ()  {                 if ($(this).is(':checked')==true)  {                     alert('Checked');                 }                 else {                     alert('Unchecked');                 }                     }); This will return the message "checked" when you select the checkbox and display "unch...

Words and their Tamil meanings

Diplomats:இராஜதந்திரிகள் Diplomat:தூதர் Disparity:ஏற்றத்தாழ்வு Instilled:சொட்டு சொட்டாக  Instill:உண்டாக்கினாள்  Onymous:ஆசிரியரின் பெயர்  Priming:டேங்குக்கு Popping:உறுத்தும் Procurement:கொள்முதல் Definitions:வரையறைகள்  Observe:கண்காணிக்க  Unaware:தெரியாமல் Chest:மார்பு Lung:நுரையீரல் Splitting:பிளக்கும் Spilt:சிந்திவிட்டது Spill:கசிவு Splay:சாய்வுண்டாக்கு Arise:எழும் Diva:திவா Indeed:உண்மையில்  Daydream:பகற்கனவு Poop:கப்பலின் பிற்பகுதி Been:இருந்து Renege:கைவிடத் Mist:மூடுபனி Shroud:காரணமில்லாத  Shrouded:மூடப்பட்ட Calcium Arsenate:கால்சியம்ஆர்செனேட்  Alalia:பேச்சுத் திறன் Affect:பாதிக்கும் Black Spot:கரும்புள்ளி Achieve:அடைய  Inbreeding:உள்ளினச்சேர்க்கைக்  Traits:பண்புகளை Shit:மலம் Kindergarten:மழலையர் பள்ளி Blasting Fuse:வெடித்திரி Cart:வண்டி Latus Rectum:செவ்வகலம்  Speculation:ஊக Courtesy:மரியாதை Setoff:சரியான எதிரீடு Ripples:இயல்பு  Patriarch:கோத்திரத்தலைவனாகிய...

Drop All tables in the current Database in Sql

Today we are going to learn some important things in Sql.I think it will be useful for SQL database Engineers.Removing tables one by one from the database rather than remove all is cumbersome when we need to drop all tables in the current database.So here i have come up with the solution for this issue.I hope this will be helpful for you as well. DECLARE @sql NVARCHAR(max)='' SELECT @sql += ' Drop table ' + QUOTENAME(TABLE_SCHEMA) + '.'+ QUOTENAME(TABLE_NAME) + '; ' FROM   INFORMATION_SCHEMA.TABLES WHERE  TABLE_TYPE = 'BASE TABLE' select @sql --Exec Sp_executesql @sql Note:Please check before execute this query.I have worked this though do it after the confirmation.

How to validate multiple textboxes using jquery?

Today we are going to see about Multiple textbox validation using jquery.In my example  i change the border color of the textbox to red if it is empty else i change the color to skyblue.For this i'm using class selector.Here we go, Jquery $('#btnsave').click(function(){ $('.test').each(function(){ if($(this).val()=' ') { $(this).css('border-color','red'); } else { $(this).css('border-color','skyblue'); } }); }); HTML <div  class='container'> <input type='text' class='form-control test' /> <input type='text' class='form-control test' /> <input type='text' class='form-control test' /> <input type='text' class='form-control test' /> </div> <div class='btn btn-primary' id='btnsave'>Click me</div>

Jquery Ajax Call

This is one of the most important concept .We can do lot of things by jquery ajax.It will prevent page loading.It is very fast normally.Here i'm going to explain the most usable format in jquery ajax call.I hope it will be useful . Here is the Basic syntax for this. $.ajax({ type: "", url: "", data: { }, dataType: "json", success: function (data){}, error: function () { } }); Explanations Type            - Post or Get url               -callback function path data             -Inputs for the callback functions dataType     -json , jsonp and so on. success       -output of the callback function will come inside. error           -Identifying errors. for Example $.ajax({ type: "post", url: "/testfunction", data: { id:1}, dataType: "json", success: function (data) ...