开发者

required attribute "action" not specified

开发者 https://www.devze.com 2023-01-19 20:22 出处:网络
first of all i m sorry for mybad 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 underst

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 开发者_Python百科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..


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

<form method="post" action="http://example.com/processform/">

There's an introduction to the action attribute here.


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.


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消