thesaleboat Posted September 9, 2008 Share Posted September 9, 2008 Does anyone know how to make the textarea in an html form reload if there is an error with the form and the page reloads? <form name="resume" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" > <span class="mainTextNoIndent"><strong>*Home Address:</strong></span><br/> <textarea name="requiredHomeAddress" id="requiredHomeAddress" value="<?php echo isset($_POST['requiredHomeAddress']) ? $_POST['requiredHomeAddress'] : '';?>" rows="3" cols="40"></textarea> </form> I didn't put all of the code up here but there are a few checks after the form to make sure the user entered certain information and that the email address is in the correct format. Link to comment https://forums.phpfreaks.com/topic/123506-solved-html-form-textarea-doesnt-reload-on-form/ Share on other sites More sharing options...
BlueSkyIS Posted September 9, 2008 Share Posted September 9, 2008 textarea content goes between tags. <textarea name='anArea' id='anArea><?php echo htmlspecialchars($whatever, ENT_QUOTES); ?></textarea> Link to comment https://forums.phpfreaks.com/topic/123506-solved-html-form-textarea-doesnt-reload-on-form/#findComment-637843 Share on other sites More sharing options...
kenrbnsn Posted September 9, 2008 Share Posted September 9, 2008 You have written incorrect HTML code. The "<textarea>" tag does not take a "value" attribute. The value is put between the opening and closing tags: <textarea name="requiredHomeAddress" id="requiredHomeAddress" rows="3" cols="40"><?php echo isset($_POST['requiredHomeAddress']) ? $_POST['requiredHomeAddress'] : '';?></textarea> Ken Link to comment https://forums.phpfreaks.com/topic/123506-solved-html-form-textarea-doesnt-reload-on-form/#findComment-637844 Share on other sites More sharing options...
thesaleboat Posted September 9, 2008 Author Share Posted September 9, 2008 kenrbnsn You my friend are the man! Thank you so much! works perfect now! Link to comment https://forums.phpfreaks.com/topic/123506-solved-html-form-textarea-doesnt-reload-on-form/#findComment-637869 Share on other sites More sharing options...
thesaleboat Posted September 9, 2008 Author Share Posted September 9, 2008 BluSkyIS thank you also that would have worked also but i have those checks done further down in the php part of the page! thanks again guys Link to comment https://forums.phpfreaks.com/topic/123506-solved-html-form-textarea-doesnt-reload-on-form/#findComment-637872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.