如何调整表单输入字段的大小

时间:2017-12-22 09:24:48

标签: php html css html5

我只想调整使用textarea的表单输入,但是我的代码无法获得更好的输出:



<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>
&#13;
&#13;
&#13;

提前非常感谢

2 个答案:

答案 0 :(得分:1)

您没有正确关闭textarea打开的代码。

更改rowscols属性值以更新heightwidth

示例:

<textarea rows="4" cols="70">
rows的{​​p> heightcols的{​​{1}}

值应该在textarea开放和关闭标记内:

width

答案 1 :(得分:1)

Textarea没有值属性...

提供这样的价值

<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>