Using the base Element to Set a Destination for Form Data

 
<!DOCTYPE HTML> 
<html> 
<head> 
    <title>Example</title> 
    <base href="http://yourServer"/> 
</head> 
<body> 
    <form method="post" action="/form"> 
        <input name="fave"/> 
        <button>Submit Vote</button> 
    </form> 
</body> 
</html>
  
Click to view this demo.

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

Home 
  HTML CSS Book 
    HTML  

form:
  1. <form> to get user input
  2. Using the base Element to Set a Destination for Form Data
  3. Configuring the HTTP method Attribute for Form element
  4. Configuring the Form Data Encoding
  5. Controlling Form Completion
  6. Specifying a Target for the Form Response
  7. Setting the Name of the Form
  8. Adding Labels to a Form
  9. Automatically Focusing on an input Element
  10. Disabling Individual input Elements
  11. Form Elements Outside the Form
Related: