tags:

views:

40

answers:

4

hi, first of all i m sorry for my bad english becouse i m not a native english speaker so may be there are some english related mistakes in my question...i hope anyone who will read my question can understand what i want to say...i m a learner

i m converting PSD to XHTML and CSS. i have completed my work but when i checked my whole code in W3c markup validation service ,i got only one error which is

Line 80, Column 14: required attribute "action" not specified

    <form>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for and type="text/javascript" for .

my question is that i dont know what should i give action to a form..

A: 

The action is the URL of the script (or application) that will process the form.

For example, the action of Google's search form is the Google search application.

If you're writing the script, you can of course choose any URL you want for it. If you're submitting the form to an existing script, find out from the author what address to use.

VoteyDisciple
+3  A: 

You want to give the URL where the form will be processed, like this:

<form method="post" action="http://example.com/processform/"&gt;

There's an introduction to the action attribute here.

Dominic Rodger
@ Dominic Rodger: thanks for help , now i understood what is action ..can u please clear about "method"...i read there is two type of method in form first one is get and second is post ...
Jam
@Jam - For an explanation of `GET` vs `POST`, w3schools is pretty good too - see http://www.w3schools.com/tags/att_form_method.asp.
Dominic Rodger
@ Dominic Rodger:thanks for help
Jam
@Jam - quite all right - if an answer answers your question, you can mark it as accepted using the check mark under the answer's score.
Dominic Rodger
A: 

When creating a form you must specify, at least, the action attribute, that points to the destination script that would receive the form data on submit.

xPheRe
A: 

Some people omit the action attribute because they want the form to submit to itself.

If that is what you want, you can do

<form action="?">

I think WebKit browsers choke if it is blank.

Or echo the current location via a server side language - don't forget to encode, because some people might do something like this...

contact.php?var=" onsubmit="alert('xss');

(although in my experience the browser itself will generally safely encode that).

alex