126Part IPHP: The BasicsAnother thing to keep in (Web hosting bandwidth)

126Part IPHP: The BasicsAnother thing to keep in mind when creating your HTML forms is that, if you ever want thisform to be displayed with prefilled inputs, you need to set the VALUEattribute. This is particu- larly relevant to two kinds of forms: those that are used to edit data from a database; andthose that are intended to possibly be submitted more than once. The latter case is very com- mon in situations where a form should redisplay on error with values already prefilled forinstance, a registration form that will not work until the user provides a valid e-mail address or other required data. For example, the form in Listing 7-1 (which represents a retirement savings calculator) isdesigned to be submitted multiple times while the user fiddles around with the values. Everytime you submit the form, the values from the previous go-round will be filled in for you auto- matically. Note the use of the VALUEattribute in the form fields in this code sample. Listing 7-1:Form with prefilled values (retirement_calc.php) A POST example: retirement savings worksheet Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply