How to use formtarget attribute in HTML?

Krantik Chavan
Published on 22-Jan-2018 10:06:59
The formtarget attribute in HTML is used to indicate where the response that is received after the form submission is displayed. It overrides the target attribute of the HTML form tag. Use the formtarget attribute only with input type submit an image.Here are the attribute values of the formtarget attribute ... Read More

How to use the formmethod attribute in HTML?

Nancy Den
Published on 22-Jan-2018 11:48:55
The formmethod attribute is used to define the HTTP technique for sending form information. This method is usedwith input type submit a picture. It overrides the method attribute of HTML forms.ExampleYou can try to run the following code to learn how to use the formmethod attribute in HTML.<!DOCTYPE html> <html> ... Read More

How to use formenctype attribute in HTML?

karthikeya Boyini
Published on 22-Jan-2018 10:39:17
The formenctype attribute is used to show how the form data should be encoded when it is submitting to the server. It introduced in HTML5 and only used with input type submit an image.Here are the formenctype attribute values −S.NoValue & Description1application/x-www-form-urlencodedThis is the default. All the characters are encoded before sent.2multipart/form-dataNone ... Read More

Why formaction attribute is not working outside of <form> tag?

Sharon Christine
Published on 19-Jan-2018 18:04:25
We can make the formaction attribute to work outside the <form> tag. The formaction attribute is used to specify more than one submit URLs for one form. When you submit a form, the web browser first checks for a formaction attribute.If the formaction is not present, the web browser moves ... Read More

How we can create singleton class in Python?

Rajendra Dharmkar
Published on 23-Jan-2018 19:06:10
Singleton pattern provides a strategy to limit the number of the instances of the class to one. Thus the same object is always shared by different parts of the code. Singleton can be considered as a more elegant solution to global variable because actual data is hidden behind Singleton class ... Read More

How we can compress large Python files?

Rajendra Dharmkar
Published on 23-Jan-2018 18:55:52
We can use Python to compress or extract files. We use the zipfile module in Python, to extract or compress individual or multiple files at once. This process is is easy and requires very little code. We begin by importing the zipfile module and then open the ZipFile object in ... Read More

How to find out if a Python object is a string?

Rajendra Dharmkar
Published on 23-Jan-2018 18:41:38
For Python 2.xTo check if an object obj is a string type or a subclass of a string type −isinstance(obj, basestring)because both str and unicode are subclasses of basestring.To check if obj is an instance of str or any subclass of str −isinstance(obj, str)To check if obj is an instance ... Read More

How do I look inside a Python object?

Rajendra Dharmkar
Published on 23-Jan-2018 18:28:07
Python has a strong set of following built-in functions to collect information about the attributes, properties and methods of any python object −type()dir()id()getattr()hasattr()globals()locals()callable()type() and dir() are particularly useful for finding the type of an object and its set of attributes, respectively.Read More

What is the lifetime of JavaScript variables?

Govinda Sai
Published on 23-Jan-2018 11:26:55
The lifetime of a JavaScript variable begins when it is declared −var rank;A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.The completion of a function deletes the local variable.A global variable has a global scope which means ... Read More

How to use formaction attribute in HTML?

Swarali Sree
Published on 19-Jan-2018 17:49:10
The formaction attribute works when let’s say you have two submit buttons in your form and you want both the buttons to work separately. Both the buttons send data to different pages. The formaction attribute overrides the form action attribute.Note − The formaction attribute is not supported in Internet Explorer 9 and earlier ... Read More