Clear Textbox Contents on Click

 

We can clear the contents of a textbox on clicking it using javascript. Create a textbox with id attribute, for example say “username”

1
<input type="text" id="username" value="Enter username" onFocus="clearall()"/>

Create a javascript function that will be called when the textbox is focused,

1
2
3
4
5
6
7
8
9
10
11
<script type="text/javascript">
function clearall()
{
var txt=document.getElementById('username');
//alert(txt.value);
//Check for the default text and clear it when the user clicks over.
if(txt.value == "Enter username"){
txt.value='';
}
}
</script>

If you want to clear the textbox without checking the text, simply use the following without any of the above code.

1
<input type="text" id="username" value="Enter username" onFocus="this.value=''"/>

Colorbox not working inside asp.net updatepanel

jQuery

 

The colorbox script wont work after partial postback or an ajax request. If the colorbox script is enclosed within an asp.net updatepanel, colorbox would fail to load the modal window. Not that colorbox but any jquery script enclosed within update panel would fail to load after the first request. To overcome this, call the colorbox or jquery script again within the following function.

//colorbox not working inside asp.net update panel

1
2
3
4
5
6
7
function pageLoad(sender, args) {
if (args.get_isPartialLoad()) {
 
// example:   $(".element_id").colorbox({ width: "43%", height: "80%", iframe: true });
 
    }
}

How To: jQuery load() not working in IE

Jquery

 

The jQuery load() is used to make ajax request to the server and place the returned html into the matched element. It would work fine with almost all the browsers like firefox, safari, chrome etc., except the internet explorer variants including IE6, IE7, IE8. This is due to problem with the IE caching mechanism. Instead of making a request to the server, it just gets the content from the cache.

The workaround for this problem would be to disable caching on the page, so that IE would make a request to the server rather than loading the cached content.

You can disable caching by adding the following meta data into the header of each page,

<meta http-equiv="Cache-control" content="no-cache">

or add the following csharp code,

1
<% Response.CacheControl = "no-cache" %>

Tags:

Auto resize colorbox window upon content

jQuery

 

Lastly, i was searching for a solution on auto resizing a colorbox modal window that was used to display iframe content. Later came across the following customization to colorbox script which ensures proper window resizing with or without scrollbars.

Get the jquery.colorbox.js script and add the following method,

 

publicMethod.myResize = function(iW, iH) {
if (!open) { return; }
var speed = settings.transition === "none" ? 0 : settings.speed;$window.unbind('resize.' + prefix);
settings.w = iW; settings.h = iH;
$loaded.css({ width: settings.w, height: settings.h });
 publicMethod.position(speed);
if (settings.scrolling) { return; } };

Read the rest of this entry »

Tags: ,

Opera Mini 5.1 For Corby

Opera Mini

 

The samsung corby’s default web browser Dolfin 1.5 is good but it often bugs me with a message like “phone memory full”. So why not try this awesome opera mini browser which is stunningly great, compared to the phone browser. The latest version which is opera mini 5.1 comes with an optimized user interface for touchscreen devices, download manager, password manager, tabbed browsing, cookie and accelerometer support etc.,

The most important feature is that you can have your data transfered with Opera compression technology, resulting in lesser data transfer.

I have tested the Opera mini 5.1 on corby pro (B5310) and it works great. The accelerometer is not working properly it seems, you have to manually change the settings for landscape mode. Read more

Twitter Application For Samsung Corby

 

I m tired of using the twitter application that comes by default with samsung corby. It is simply good to view the timeline but not with many features to retweet or to check the links etc., There are bunch of java clients for using twitter on mobile phones but none of them are perfect like the one used on smart phones. Here are some two applications that i found interesting, comes with maximum features and works good on samsung corby.

Twibble:

This application has got almost every feature that is on twitter web page and more importantly, it’s a FREE software. This works almost flawless on corby pro except that i faced problem with adding picture via twitpic. It posted some IoException error but it worked fine when i used the other option, mobypicture. Some nice features include,

Read More

Tags:

“Hackers Wanted”, Documentary Pops Up At BitTorrent Community

 

An unreleased movie about hackers directed by Sam Bozzo shows up at pirate bay. The movie story goes around Adrian Lamo, a hacker who got convicted of compromising the internal network of The New York Times. This movie wasnt released due to some conflict between its producer and team members. The latest version of the movie seem to contain additional footage and is significantly different from the leaked one according to an insider.

Adrian Lamo said he was aware of the release and he got nothing to do with the leak.

Read More

Tags:

Check CPU Temperature on Linux

 

There are chances that your cpu sometimes gets overheated due to some applications utilizing the full cpu power. You can check the cpu temperature by a simple ACPI command. For this you should have the ACPI application installed on your linux box.

To install the application,
Sudo apt-get install acpi

Read More

Tags:

Remove Huge Kernel Lists In Ubuntu

 

Sometimes we wonder why in the world this grub menu list goes wider day by day, this is simply because of the reason that we are installing kernel updates when we run the update manager in ubuntu. Its not necessary to keep all the older kernels. we could remove them but it is advised to keep two kernel versions since, in cases when the newly installed kernel fails we could boot into the older one.

 

Follow the steps carefully,

Open terminal and issue the following command to check the list of kernels installed on your machine.

ls /boot | grep vmlinuz

Read More

Tags: , ,

Mounting and Unmounting Windows Partition and Smb Shares in Linux

 

If you were some windows addict and have no clue about linux partitions then i pretend you could find the partition atleast by the size,

open terminal and install gparted
sudo apt-get install gparted

Open gparted, you could identify partitions mapped as /dev/sda1 or /dev/sda2 or /dev/hda1 or /dev/hdb1 etc like i said before, i pretend you could identify the partition to be mounted based on the size. If you have two or more hard drives then you can choose between them from the drop down on the top right corner. Once you are done choosing the partition just note down the corresponding partition’s filesystem which may be ntfs or fat32.

Read More

Tags: , , , , ,