开发者

Please find problem in my html <form> tag

Hi? I'm a university student of Korea, and this semester I'm studying internet programming.

I made html, and I made tag. However I think tha开发者_JAVA技巧t there is problem in my tag. In fact I hardly effort to find problem, but I cannot find that.

Experts!!!Please find the problem!!!! This is my form tag.

<html>
<head></head>
<body>
<form name="firstForm" action="http://kisschks.hosting.paran.com/noname2.php">
<table width=500 border=1>
<tr>
<td width=100>이름</td>
<td><input name="name" type="text" size="15"></td>
</tr>
<tr>
<td>비밀번호</td>
<td><input type="password" name="password" size="20" maxlength="15"></td>
</tr>
<tr>
<td>학번</td>
<td><input type="text" name="schoolnum" size="21"></td>
</tr>
<tr>
<td>전화번호</td>
<td><select name="fst">
    <option value="010" selected>010</option>
    <option value="011">011</option>
    <option value="016">016</option>
    <option value="017">017</option>
    <option value="018">018</option>
    <option value="019">019</option>
    </select> - <input name="sec" type="text" size="4" maxlength="4"> - <input name="trd" type="text" size="4" maxlength="4">
</td>
</tr>
<tr>
<td>캠퍼스</td>
<td>
<input type="radio" name="campus" value="명륜">명륜
<input type="radio" name="campus" value="율전" checked>율전
</td>
</tr>
<tr>
<td>학년</td>
<td>
<input type="checkbox" name="year" value="1학년" checked>1학년
<input type="checkbox" name="year" value="2학년">2학년
<input type="checkbox" name="year" value="3학년">3학년
<input type="checkbox" name="year" value="4학년">4학년
<input type="checkbox" name="year" value="휴학">휴학
</td>
</tr>
<tr>
<td>고향</td>
<td><textarea name="고향" rows=3 cols=20>
</textarea>
</td>
</tr>
<tr>
<td>하고픈말</td>
<td><textarea name="intro" rows=3 cols=20></textarea></td>
</tr>
<tr>
<td colspan=2 align="center">
<input type="button" value="안씁니다" disabled>
<input type="reset" value="다시작성">
<input type="submit" value="등록">
</td>
</tr>
</table>
</form>
</body>
</html>


You have not mentioned your problem exactly but I do find charset meta missing for the Korean language you are using on the form:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Interesting Resources:

  • What Beautiful HTML Code Looks Like
  • Fix Your Site With the Right DOCTYPE!


One thing that might be relevant is that you haven't specified either method="POST" or method="GET" in your form tag. Though if you're using $_REQUEST in your php it shouldn't matter either way.


Well, you didn't say what your code was doing wrong or what you expected but didn't get... but...

Go to:

http://validator.w3.org/#validate_by_input

and paste your code in there. It turns out the <head> element cannot be empty. Don't just take my revision below, you really should read the output of the Validator to understand what kind of changes needed to be made in order to achieve valid HTML.

Here is valid code that should work:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
      hello
    </title>
  </head>
  <body>
    <form id="firstForm" action="http://kisschks.hosting.paran.com/noname2.php">
      <table width="500" border="1">
        <tr>
          <td width="100">
            이름
          </td>
          <td>
            <input name="name" type="text" size="15" />
          </td>
        </tr>
        <tr>
          <td>
            비밀번호
          </td>
          <td>
            <input type="password" name="password" size="20" maxlength="15" />
          </td>
        </tr>
        <tr>
          <td>
            학번
          </td>
          <td>
            <input type="text" name="schoolnum" size="21" />
          </td>
        </tr>
        <tr>
          <td>
            전화번호
          </td>
          <td>
            <select name="fst">
              <option value="010" selected="selected">
                010
              </option>
              <option value="011">
                011
              </option>
              <option value="016">
                016
              </option>
              <option value="017">
                017
              </option>
              <option value="018">
                018
              </option>
              <option value="019">
                019
              </option>
            </select> - <input name="sec" type="text" size="4" maxlength="4" />- <input name="trd" type="text" size="4" maxlength="4" />
          </td>
        </tr>
        <tr>
          <td>
            캠퍼스
          </td>
          <td>
            <input type="radio" name="campus" value="명륜" />명륜 <input type="radio" name="campus" value="율전" checked="checked" />율전
          </td>
        </tr>
        <tr>
          <td>
            학년
          </td>
          <td>
            <input type="checkbox" name="year" value="1학년" checked="checked" />1학년 <input type="checkbox" name="year" value="2학년" />2학년 <input type="checkbox" name="year" value="3학년" />3학년 <input type="checkbox" name="year" value="4학년" />4학년 <input type="checkbox" name="year" value="휴학" />휴학
          </td>
        </tr>
        <tr>
          <td>
            고향
          </td>
          <td>
            <textarea name="고향" rows="3" cols="20">
</textarea>
          </td>
        </tr>
        <tr>
          <td>
            하고픈말
          </td>
          <td>
            <textarea name="intro" rows="3" cols="20">
</textarea>
          </td>
        </tr>
        <tr>
          <td colspan="2" align="center">
            <input type="button" value="안씁니다" disabled="disabled" /><input type="reset" value="다시작성" /><input type="submit" value="등록" />
          </td>
        </tr>
      </table>
    </form>
    <p>
      html form ta
    </p>
  </body>
</html>

Note that in the <html> tag, it specifies English as the language. I suspect that is not the correct language, but you can fix that yourself once you get everything else working.

Good luck with your studies.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜