Stop Page Refreshing on Submit in JavaScript

Shubham Vora
Updated on 02-Sep-2023 11:31:26

94K+ Views

In this tutorial, we shall learn to stop form refreshing the page on submitting in JavaScript. Let’s cover the methods to accomplish this objective. Using event.preventDefault() to stop page refresh on form submit In this section, we will see how to use event.preventDefault() to stop page refresh on form submission. The event.preventDefault() restricts the default page refresh behavior of the form during form submission. Users can follow the syntax below to try this method. Syntax The syntax defines the form. //Get form element var form=document.getElementById("formId"); function submitForm(event){ ... Read More

Add Element to a JavaScript Object

Vivek Verma
Updated on 02-Sep-2023 11:27:38

74K+ Views

In JavaScript, the object is a real-time entity that contains properties and methods. In simple words, we can say that object is an instance of a class. It stores the data in the form of key and value pairs. The keys are usually referred to as properties and the values are referred to as property values. There are two ways to define an object in JavaScript. Syntax var obj = new Object(); (or) var obj = {property1: value, property2 : value2 …….} Using dot (.) operator In JavaScript, using the dot (.) operator we can access a variable ... Read More

Difference Between Open Loop and Closed Loop Control System

Manish Kumar Saini
Updated on 02-Sep-2023 11:24:35

123K+ Views

A control system is defined as the mechanism or a system that provides the desired response or output by controlling the input and processing system. These days, control systems are being implementing in every smart devices and systems such as traffic lights system, washing machine, rocket launching systems, electrical power system, etc. Depending on the feedback path present in the system, the control systems can be classified into following two types, viz − Open Loop Control System Closed Loop Control System In this article, we will discuss all the major differences between open loop and closed loop control ... Read More

Embed Video Using HTML Code

Nitya Raut
Updated on 02-Sep-2023 11:22:37

73K+ Views

To embed a video in an HTML page, use the element. The source attribute included the video URL. For the dimensions of the video player, set the width and height of the video appropriately.The Video URL is the video embed link. The video we will be embedding our example will be YouTube.To get the embed link, go to a YouTube Video and click embed as shown below. You will get a link for embed here −You can try to run the following code to learn how to embed a video using HTML code. Copy the embed link as shown ... Read More

The TCP/IP Reference Model

Jai Janardhan
Updated on 02-Sep-2023 11:09:51

78K+ Views

TCP/IP Reference Model is a four-layered suite of communication protocols. It was developed by the DoD (Department of Defence) in the 1960s. It is named after the two main protocols that are used in the model, namely, TCP and IP. TCP stands for "Transmission Control Protocol" and IP stands for "Internet Protocol".The four layers in the TCP/IP protocol suite are −Host-to- Network Layer −It is the lowest layer that is concerned with the physical transmission of data. TCP/IP does not specifically define any protocol here but supports all the standard protocols.Internet Layer −It defines the protocols for logical transmission of ... Read More

Advantages and Disadvantages of Internet

Pranavnath
Updated on 02-Sep-2023 10:57:33

116K+ Views

When many computers are connected, connecting means that they can share data such as text, information, photos, audio, videos and many other services together making a "Network". When this network happens worldwide, that becomes the Internet. Take a real-life simple example, when you are seeing photos on Instagram, tweets on Twitter, or talk through Facebook, that is when you are connected to the internet. Things are happening worldwide. The Internet is used on a vast level, and it is impossible to imagine our world without the Internet. Not only for personal use, organizations and government sectors are also connected to ... Read More

Error Detection and Correction in Data Link Layer

Ankith Reddy
Updated on 02-Sep-2023 10:55:46

105K+ Views

Data-link layer uses error control techniques to ensure that frames, i.e. bit streams of data, are transmitted from the source to the destination with a certain extent of accuracy.ErrorsWhen bits are transmitted over the computer network, they are subject to get corrupted due to interference and network problems. The corrupted bits leads to spurious data being received by the destination and are called errors.Types of ErrorsErrors can be of three types, namely single bit errors, multiple bit errors, and burst errors.Single bit error − In the received frame, only one bit has been corrupted, i.e. either changed from 0 to ... Read More

Limit Characters in Form Input Text Field

Lokesh Badavath
Updated on 02-Sep-2023 10:53:26

69K+ Views

In this article, we will learn how to limit the number of characters allowed in form input text field. We use tag to get user input in HTML. To give a limit (or range) to the input field, we use the min and max attributes, which is to specify a maximum and minimum value for an input field respectively. To set the maximum character limit in input field, we use maxlength attribute. This attribute is used to specify the maximum number of characters enters the field. To set the minimum character limit in input field, we ... Read More

Find Duplicate Values in a JavaScript Array

Abhishek
Updated on 02-Sep-2023 10:47:49

72K+ Views

In this tutorial, we will discuss how we can find duplicate or repeating values in a JavaScript array using different methods or approaches to reach the solution to this problem. Below is the list of the approaches or methods we can use to solve the problem of finding duplicates − By simply Traversing the Array Using the filter() and indexOf() Methods Using the Set object and has() Method Let us discuss all of the above approaches to find duplicates in the JavaScript array − By Simply Traversing the Array Traversing the array using a nested for loop to ... Read More

Starting and Stopping MySQL Server

AmitDiwan
Updated on 02-Sep-2023 10:40:03

84K+ Views

Let us understand how MySQL server can be started and stopped on Linux and Windows −Linux – Start and Stop ServerOn Linux, the start and stop can be done from the command line as shown below −/etc/init.d/mysqld start /etc/init.d/mysqld stop/etc/init.d/mysqld restartLinux – Service CommandsSome Linux types offer service command as well −service mysqld startservice mysqld stop service mysqld restart(or)service mysql startservice mysql stopservice mysql restart Windows – Start and Stop ServerLet us understand how it can be done on Windows −Open 'Run' Window by using Win key + RType 'services.msc'Now search for MySQL service based on the version that ... Read More

Advertisements