form action='' - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:form

Introduction

The form element action attribute sets where the browser should send the data when the form is submitted.

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

If you don't set the action attribute to the form element, the browser will send the form data to the same URL that the HTML document was loaded from.

Using the base Element to Set a Destination for Form Data

The base element affects all relative URLs in an HTML document, not just the form element.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
      <base href="http://example:8080"> 
   </head> 
   <body> 
      <form method="post" action="/form"> 
         <input name="fave"> 
         <button>Submit Vote</button> 
      </form>  
   </body><!--   www.  j  a v a  2  s  .  c o  m-->
</html>

Related Tutorials