Reputation: 45
I just want to resize my form input useing textarea but I could not get a better output this my code:
<html>
<head>
<form role="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="signupform">
<fieldset>
<legend>Sign Up</legend>
<label for="name">message</label>
<textarea input type="text" name="message" placeholder="Enter your message" cols="20" rows="20" required value="<?php if($error) echo $message; ?>" </span>
</div>
<label for="name">number</label>
<textarea input type="text" name="number" placeholder="input number" cols="20" rows="20" required value="<?php if($error) echo $number; ?>" </
textarea></span>
</div>
<input type="submit" name="signup" value="Sign Up" />
</div>
</fieldset>
</form></body>
</html>
big thanks in advance
Upvotes: 0
Views: 2183
Reputation: 4141
You didn't closed your textarea opened tag properly.
Change your rows
and cols
attribute values for updating height
and width
.
Example:
<textarea rows="4" cols="70">
rows
for height
and cols
for width
And value should be inside textarea open and closed tag as:
<textarea input type="text" name="number" placeholder="input number" cols="70" rows="4" required>
<?php if($error) echo $number; ?>
</textarea>
Upvotes: 1
Reputation: 2327
Textarea doesn't have value attribute...
Provide value like this
<html>
<head>
</head>
<body>
<form role="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="signupform">
<fieldset>
<div>
<legend>Sign Up</legend>
<label for="name">message</label>
<textarea input type="text" name="message" placeholder="Enter your message" cols="20" rows="20" required><?php if($error) echo $message; ?></textarea>
</div>
<div>
<label for="name">number</label>
<textarea input type="text" name="number" placeholder="input number" cols="20" rows="20" required ><?php if($error) echo $number; ?></textarea>
</div>
<div><input type="submit" name="signup" value="Sign Up" /></div>
</fieldset>
</form>
</body>
</html>
Upvotes: 1