ptg16476052
Using the <form> Tag 321
12
action specifies the URL to which the form is submitted. Again, remember that for the
form to be submitted successfully, the script must be in the exact location you specify
and must work properly.
If you leave out the action attribute, the form is submitted to the current URL. In other
words, if the form appears on the page http://www.example.com/form.html and you leave
off the action attribute, the form will be submitted to that URL by default. This prob-
ably doesn’t seem very useful, but it is if your form is generated by a program instead
of residing in an HTML file. In that case, the form is submitted back to that program for
processing. One advantage of doing so is that if you move the program on the server, you
don’t have to edit the HTML to point the form at the new location.
Although most forms send their data to scripts, you also can make the action link to
another web page or a mailto link. The latter is formed as follows: