Text Area

I have a form and a question i have is … If “No” please tell us how many bedrooms have ensuite and how many seperate bathrooms.

This is a text area. I want to display a default value if nothing is entered into the text area. Say “No information submitted”

<textarea name="howmany"><?php if (isset($_POST['howmany'])) { echo htmlspecialchars($_POST['howmany']); } ?></textarea>

in the form handler i have this.

"How Many Bedrooms Have An Ensuite And How Many Bathrooms: \n $howmany \n \n".

try this

<textarea name="howmany"><?php echo isset($_POST['howmany']) && trim($_POST['howmany']) != '' ? htmlspecialchars($_POST['howmany']) : 'No information submitted'; ?></textarea>

thank you for your advice.

Sponsor our Newsletter | Privacy Policy | Terms of Service