Join Onbux For Free and Earn Money

Submit a Form Using Enter Key



I have a form like this






I want to submit this form after entering password field by pressing enter key. How can I do that?


Answer:



It's a very simple thing. You just need to call a javascript on 'onkeypress' event of the text box.



<td><input name="password" type="password" onkeypress="enableKey()" /></td>


If you're doing any client side validation on this page, you need to call that function inside enableKey().


My enableKey function looks like this.

function enableKey(){

if(window.event.keycode==13){

loginValidation();

}
}





Multitasking



Multitasking is a method with multiple processes share common resources like CPU. Multiprocessing is similar to multitasking, but in multiprocessing more than one CPU is involved. In multitasking only one CPU is involved, the CPU is switched from one task to another so quickly, so that each user gets the impression that CPU is used by him only.


There are two types of multitasking: Preemtive and Cooperative multitasking. In preemptive multitasking, operating systems assigns time slice to each processes that are waiting for the execution. When the time slice of an executing program has expired, that process is taken from the CPU and the waiting process gets a chance to use CPU. In cooperative multitasking, each program can control the CPU as long as it needs it. Unlike in preemptive multitasking, here program itself owns the control of CPU.

Process vs Threads


A process is an executing instance of an application. For example when you double click on a word program, a new process starts. When a process starts, a separate memory area is created for that process.

A process consists of several executable programs called threads, that works together as a whole. Process are heavyweight tasks and threads are light weight tasks. For example, when you start the word program, the autosave and spell check features are running in the background and these are called threads which operate on the same data set.

Threads with in the same process share the same address space. Therefore, this allows communication between threads and also allows thread to read and write to the same data structures.