If there is submit button in a from tell us the sequence
what happens if submit is clicked and in form action is
specified as some other page ?

Answer Posted / supraja kuppam

The user agent or browser sends the form data to the URL
contained in the form's "action" attribute. The action is
performed by taking the input elements and performing the
logic. We will not be discussing actions in these articles
since there are many ways to performance actions depending
on the programming language you are using.

There are several HTML elements designed just for forms.
Some elements are designed for the layout and grouping of
the form fields, while others are designed for input from
the user. Let's explore some of these HTML elements.
The FORM Element

Syntax:
<form action="url to submit form data"
accept="MIME Type" accept-charset="character set"
enctype="text/plain|
application/x-www-form-urlencoded|multipart/form-data"
method="get|post">
</form>

All forms begin with a <form> HTML tag and end with a
</form> HTML tag. All form specific HTML tags are placed in
between the opening and closing <form> HTML tags. You can
have multiple <form> tags on the page. Each tag can have a
different action.
The ACTION Attribute

The "action" attribute is the only required attribute and
specifies what URL to use to send the form data. When the
user clicks a button on the form, the action is invoked.
There can only be one action for the form. You can have
multiple buttons on a form that would perform different
actions, but they would all still submit to the same URL.
Multiple buttons will be discussed in detail later.
The ACCEPT Attribute

The "accept" attribute allows you to specify what types of
files a user can submit through the file upload. Forms can
collect user input from form fields and may also accept
files to upload. The accept attribute limits the file types.
This attribute is optional and if it is not specified, any
file type may be uploaded.

The values for the accept attribute are specified by
"MIME_type" values. MIME type is sometimes referred to
content type. Examples of these values are: text/plain,
text/html, image/png, and image/gif. You can specify more
than one MIME type by separating them by commas. The accept
attribute is only used if the form contains an <input> tag
with a type set to "file".

The browser may look at the MIME types and filter the list
of files in the upload dialog box accordingly. This is a
function the browser must support. What does that mean? It
means that a user could select an image even though the
attribute is set to accept only HTML files. Why is that?
Well, MIME type is controlled by the operating system and
since different operating systems handle MIME types
differently, the browser must be able to understand that.
The ACCEPT-CHARSET Attribute

The "accept-charset" attribute is the list of character sets
the server can use for the form data. This attribute is
optional, but it can help to limit forms to a certain
character sets. The character sets are separated by either a
space or a comma. Examples of these values are: ISO-8859-1,
ISO-8859-2, etc.

Why would you use this? Let's say you have a form that will
route depending on a keyword that is entered in one of the
form fields. If a user enters Kanji (Japanese) characters,
the form processor might not handle it properly. Of course,
you should make sure the form processor can handle problems
like this, but still, you might not have control over that
so you can limit this using this attribute.
The ENCTYPE Attribute

The "enctype" attribute specifies the encoding used to
encode the form data before it is sent to the server. There
are two values: application/x-www-form-urlencoded and
multipart/form-data. There can only be one encoding type per
form.

When the method of the form is set to "post", the encoding
is set to "application/x-www-form-urlencoded". This is done
by default so you do not need to specify the encoding type.
What this does is convert some values to escaped values.
Spaces will be replaced by a "+" and reserved characters
will be converted to a percent sign and two hexadecimal
digits representing the ASCII code of the character.
The METHOD Attribute

The "method" attribute tells the form's action what to do.
This is also referred as the HTTP method. There are two
methods used: get and post. The get method appends the form
data to the URL specified in the action attribute and the
form is sent to the form processor. The form data is
appended using the question mark ("?") and the data is
separated by ampersands ("&"). In figure 2, you will see the
form HTML and below that is the URL that is generated when
the form is submitted. You will also notice that the name of
the input control is also included. The post method includes
the form data in the body of the form and is sent to the
form processor.

The attributes above are form only attributes. The form HTML
tag also supports many of the standard HTML attributes like
id, lang, style, and title. It also supports client-side
style attributes like onsubmit, onreset, onclick, etc.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you open a page in a new window?

546


What is difference between cookies and cache?

514


What is the namespace to create thread in .net?

518


What is the difference between a candidate key and primary key?

517


What is .net remoting?

563






In the Repeater control which way you can edit?

639


What is the difference between the get method () and post method ()?

511


What is the difference between an htmlinputcheckbox control and an htmlinputradiobutton control?

616


Define data caching?

537


What is meant by ispostback in asp net?

537


Is asp net front end or backend?

520


What is session in web technology?

516


Explain about secure socket layer?

518


Describe paging in asp.net?

671


What are validator? Name the validation controls in asp.net?

493