HTML5 textarea allowed character limit validation

Tags

, , , ,

Always use input event for validation so as whenever key press or up but does not change the text change the content in textarea like cltr / Alt / up / down keys , mouse roller paste in linux ,  that time events like keyup , press will not work

so use input change event every time for input field validation.

also make sure server side validation working

<textarea class=”col-md-12 form-control” rows=”5″ id=”msg” name=”msg”></textarea>

var allowedCount=110;
var textCount=$(“#msg”).val().length;;
$(“#infomsg”).empty().text(allowedCount);

$(“#msg”).on(‘keyup change input’,function(){
textCount = $(“#msg”).val().length;
if(textCount <= allowedCount){
$(“#infomsg”).empty().text((allowedCount-textCount));
}else if(textCount > allowedCount){
$(“#msg”).val($(“#msg”).val().substr(0, allowedCount));
$(“#infomsg”).empty().text($(“#msg”).val().length);
}else{
return false;
}
});

Jquery Dynamic element create and remove creating issue with event listner

Tags

, , ,

If you have used .remove() method for dynamically remove and append element somewhere inside the DOM then event binding will not work on that particular element, for that we can use .detach() method , this will provide you return object of element removed and then you can append that element/Object inside DOM so that event bind on that particular element will remains as it is.

Also please note if you are creating element dynamically than bind jquery event with .on() method.

issue faced during

  • removing DOM element on document.ready()
  • appending it to Other DOM element on document.ready();
  • now attaching event listeners
  • but still event listeners was not working due to .remove() was use
  • i applied fix with .detach()  method

How to find the Username from ip Address in LAN in Windows

Tags

, , , ,

To get another machine’s identity on the LAN network:

  • Open Command (Start > Run > CMD)
  • Type:

NBTSTAT -A IPADDRS

OR

TRACERT IPADDRESS

Response 

VirtualBox Host-Only Network:
Node IpAddress: [0.0.0.0] Scope Id: []

Host not found.

Ethernet:
Node IpAddress: [0.0.0.0] Scope Id: []

Host not found.

Wi-Fi:
Node IpAddress: [192.168.1.193] Scope Id: []

NetBIOS Remote Machine Name Table

Name Type Status
———————————————
AAA-PC <20> UNIQUE Registered
AAA-PC <00> UNIQUE Registered
WORKGROUP <00> GROUP Registered
WORKGROUP <1E> GROUP Registered

MAC Address = 00-00-7D-80-A5-4E

apk file uploading is not allowed in codeigniter

Tags

, , , , ,

We have mentioned the $config[‘allowed_types’]= ‘apk’;

But when i try to upload file on the server it shows me error that “The filetype you are attempting to upload is not allowed.”

To Avoid the error we need place below line inside the application/config/mines.php file

‘apk’ => array(‘application/x-zip’, ‘application/zip’, ‘application/x-zip-compressed’, ‘application/vnd.android.package-archive’, ‘application/octet-stream’),

 

 

How to Check Or Assign IP of the linux centos server using WHM panel?

Tags

, , , , , ,

create / check the name server with proper ip using below mentioned steps

  1. Click to Server configuration tab
  2. Click on Basic cPanel & WHM Setup
  3. Now check the Name server at the bottom of the page

here you will find the name server of your server with the Provided ip likens1.domain-name.com and ns2.domain-name.com

NOTE: it is not necessary to create at least 2 name server with the same ip address.Otherwise you will get an issue in reverse DNS.

If your Reverse DNS is not proper then you will face the issue in emails which are configure to server also you will face many issue regarding the domain resolution over the World major name server.

How dose DNS Works [External DNS]

The DNS is a distributed system, meaning that only the 13 root servers contain the complete database of names and addresses. All other DNS servers are installed at lower levels of the hierarchy and maintain only certain pieces of the overall database.

Most lower level DNS servers are owned by businesses or Internet Service Providers (ISPs). For example, Google maintains various DNS servers around the world that manage the google.com, google.co.uk, and other domains. Your ISP like hathway,Tata,Airtel etc.  also maintains DNS servers as part of your Internet connection setup. Continue reading