HTML必需标记不适用于名称,图片,年龄,它只是电子邮件的形式

时间:2015-12-12 16:04:52

标签: html html5

必填字段仅适用于电子邮件,名称,年龄,单选按钮不起作用..请帮助

我已经在不同的浏览器中尝试过所有内容,但是因为一个必填字段正在运行而另一些正在运行..我无法弄清楚

  约会网站

<body>
  <div class="heading ">
    <center>
      <h1>Please enter your details for our <SPAN style="color:blue">Dating Website  </SPAN></h1></center>

  </div>

  <div class="firstfieldset">
    <form action="https://ihome.ust.hk/~rossiter/cgi-bin/show_everything.php">
      <fieldset>
        <legend>Your face</legend>
        <label for="pic">Your Image :</label>
        <input type="file" name="pic" id="pic" accept="image/*" required></input>
        <br>
        <label for="img_prev">Image preview:</label>

        <img id="img_prev ">
      </fieldset>
    </form>
    <!-- end of fisrt form-->
  </div>


  <div class="secondfiledset">
    <label for="firstname">First name:</label>
    <input type="text" name="firstname" id="firstname" placeholder="Enter your first name.." required />

    <label for="lastname">Last name:</label>
    <input type="text" name="lastname" id="lastname" placeholder="Enter your last name.." />
    <br>
    <label for="sex"> Gender:</label>

    <input type="radio" name="sex" id="sex" value="male" required>Male</input>
    <input type="radio" name="sex" id="sex" value="female" required>Female</input>
    <br>
    <label for="age">Your Age :</label>
    <input type="number" name="age" id="age" required>
    <br>
    <label for="dob">Date of birth:</label>

    <input type="date" id="dob" name="dob"></input>
    <br>
    <label for="color">Fav color</label>

    <input type="color" id="color" name="color"></input>
    <br>
    <label for="country"> Which Country :</label>

    <select id="country">
      <option></option>
      <option value="U.S.A">U.S.A</option>
      <option value="China">China</option>
      <option value="Japan">Japan</option>
      <option value="Pakistan">Pakistan</option>
      <option value="Russia">Russia</option>
    </select>
    </fieldset>
    </form>
  </div>

  <div class="thirdfiledset">
    <form action="https://ihome.ust.hk/~rossiter/cgi-bin/show_everything.php">
      <fieldset>
        <legend>Your Indicators </legend>
        <label for="height">Height:Low</label>

        <input type="range" id="height" name="height" min="0" max="100">High</input>
        <br>
        <label for="salary">Salary:Low</label>

        <input type="range" min="0" max="100" id="high" name="salary">High</input>
      </fieldset>

    </form>
  </div>

  <div class="fourthfieldset">
    <form action="https://ihome.ust.hk/~rossiter/cgi-bin/show_everything.php">
      <fieldset>
        <legend>Your Conatct Information</legend>
        <label for="email">Your Email :</label>
        <input type="email" name="email" id="email" required>
        <br>
        <label for="mobile"> Mobile:</label>
        <input type="number" id="mobile" name="mobile">
        <br>
        <label for="address">Address:</label>
        <input type="text " id="address" name="address">
        <br>
        <label for="contact method">Method to contact you :</label>
        <input type="radio" name="contact method" id="contact method" value="Email">Email</input>
        <input type="radio" name="contact method" id="contact method" value="WhatsApp">WhatsApp</input>
        <input type="radio" name="contact method" id="contact method" value="Snap Chat ">Snap Chat</input>
        <br>


      </fieldset>
      <label for="submit"></label>
      <input type="submit" id="submit" name="submit" value="Submit">
    </form>
  </div>


</body>

2 个答案:

答案 0 :(得分:1)

在第二部分中,缺少开场标记<form><fieldset>

如果没有帮助,请发布JS代码

答案 1 :(得分:0)

necesitas englobar todos tus input dentro del form,ytambiénrevisasi antes de tu tienes la meta etiqueta con lo que le especificas al explorador que vas atrabajar con html5

像这样:

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>