note 86146 deleted from tutorial.forms by philip
| From: | philip@php.net | Date: | Sun, 30 Nov 2008 04:11:59 +0000 |
| Subject: | note 86146 deleted from tutorial.forms by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147432@lists.php.net to get a copy of this message | ||
Note Submitter: wbcarts at juno dot com
----
Good tips everybody, thanks! A brief summary:
SERVER-SIDE PROCESSING (GET and POST)
<!-- If your form submission WILL NOT WRITE anything on the SERVER-SIDE, use GET -->
<form action="action.php" method="get">
<!-- If your form submission WILL WRITE some data on the SERVER-SIDE, use POST -->
<form action="action.php" method="post">
CLIENT-SIDE PROCESSING (ID and NAME)
<!-- If the CLIENT-SIDE NEEDS to access or modify this field, use the id attribute -->
<input id="firstName" name="firstName" type="text">
<!-- create a script that runs on the CLIENT-SIDE to access and modify the field -->
<script type="javascript">
var firstName = document.getElementById("firstName");
firstName.value = 'some text';
firstName.focus();
</script>
<!-- If the CLIENT-SIDE DOES NOT NEED to access or modify this field, -->
<!-- then there is no need for the ID attribute or a client side script -->
<input name="firstName" type="text">
Note the HTML SYNTAX:
- In <form>, 'get' and 'post' are the VALUE of the attribute named
'method'.
- In <input>, 'id' and 'name' are the NAME of the attribute with values
of 'firstName'.