I have a simple Q&A Form laid out like this...
How can I add a "place holder" for the Error Messages, so when they occur my Fields don't shift down?!Code:<label> <textarea> <error message>
Here is my HTML/PHP...
Thanks,HTML Code:<form id="changeAnswers" action="" method="post"> <fieldset> <legend>Change Profile Answers</legend> <?php // Display Q&A's. foreach($thoughtsArray as $questionNo => $qaArray){ // Build Question. echo '<label for="question' . $questionNo . '">' . $questionNo . '.) ' . $qaArray['questionText'] . "</label>\n"; // Build Answer. echo '<textarea id="question' . $questionNo . '" name=answer[' . $qaArray["questionID"] . ']" cols="60" rows="2">'; echo (isset($questionNo) ? htmlentities($qaArray['answerText'], ENT_QUOTES) : ''); echo "</textarea>\n\n"; // Display Error. if (!empty($errors[$qaArray['questionID']])){ echo '<br /><span class="error">' . $errors[$qaArray['questionID']] . "</span><br />\n\n"; } } ?> <!-- Submit Form --> <input type="submit" name="changeAnswers" class="button" value="Change Answers"/> <input type="reset" class="button" value="Cancel" /> </fieldset> </form>
Debbie



Reply With Quote
Bookmarks