With multiline text fields, almost the same approach as with single-line text fields and password fields can be used. The only difference is the location where to put the prefill value: It belongs between <textarea> and </textarea>, as shown in the code. Prefilling Multiline Text Fields (textarea.php; excerpt)<?php require_once 'stripFormSlashes.inc.php'; ?> ... <textarea cols="40" rows="5" name="areafieldname"><?php echo (isset($_POST['areafieldname'])) ? htmlspecialchars($_POST['areafieldname']) : ''; ?></textarea>
Using the combined cookie/GET or cookie/POST approach, the code simplifies a bit. Prefilling Multiline Text Fields (textarea-cookie.php; excerpt)<?php require_once 'stripFormSlashes.inc.php'; require_once 'getFormData.inc.php'; ?> ... <textarea cols="40" rows="5" name="areafieldname"><?php echo htmlspecialchars(getFormDataPOST ('areafieldname')); ?></textarea> |