Jump to content

[SOLVED] HTML Form textarea doesn't reload on form


thesaleboat

Recommended Posts

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.

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.