LoginSignup
2
1

More than 1 year has passed since last update.

ChatGTP で フォームHTML生成

Posted at

 ChatGPTで、テーブルで表現した仕様から、Bootstrap5のフォームを生成してみました。

 下記のような、テーブルを spredsheets で作成し、

ラベル input type choice 必須
名前 text
フリガナ text
性別 radio 男性、女性

ChatGPT に次のようにお願いすると

下記の入力項目の仕様で  bootstrap5 を利用したフォームのHTMLコードを生成して
ラベル	input type	choice	必須
名前	text		○
フリガナ	text		○
性別	radio	男性、女性	○

 HTMLを生成してくれました。オンラインのHTMLエディタで確認したところ、問題なく表示されています。

<form>
  <div class="form-group">
    <label for="name">名前</label>
    <input type="text" class="form-control" id="name" required>
  </div>
  <div class="form-group">
    <label for="kana">フリガナ</label>
    <input type="text" class="form-control" id="kana" required>
  </div>
  <div class="form-group">
    <label for="gender">性別</label><br>
    <div class="form-check form-check-inline">
      <input class="form-check-input" type="radio" name="gender" id="male" value="male" required>
      <label class="form-check-label" for="male">男性</label>
    </div>
    <div class="form-check form-check-inline">
      <input class="form-check-input" type="radio" name="gender" id="female" value="female" required>
      <label class="form-check-label" for="female">女性</label>
    </div>
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>

 仕様から、簡単にHTML画面を生成でき、プロトタイピングが捗りそうです。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1