Working with Submit Buttons


Clicking a submit button (Figure 68.11) sends off the data of the form for processing. Where the form data goes appears in the form tag's action attribute, and how the form data goes appears in the form tag's method attribute.

Listing 68.11. View Source for Figure 68.11.
 <form action="/forms/process.php" method="POST">   <input type="submit" name="formSubmit" value="Submit Form"> </form> 

Figure 68.11. A submit button sends the form data to the Web server for processing.


In this example, clicking the submit button sends the form data via the POST method. The submission follows the root-relative path in the action attribute, winding up on a page called process.php, which would contain server-side code for processing the form data.

FAQ

How do I process form data?

Unfortunately, you need server-side scripting to process and use form data, which is beyond the scope of this humble tome.

Don't send your submission to a client-side document like an HTML page or JavaScript file, because the browser won't know what to do with it.


As with other buttons, the text in the submit button's value attribute appears on the button's face.



Web Design Garage
Web Design Garage
ISBN: 0131481991
EAN: 2147483647
Year: 2006
Pages: 202
Authors: Marc Campbell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net