0
0

More than 1 year has passed since last update.

PHP:バリデーションエラー時にformで入力した値を消さないようにする

Last updated at Posted at 2023-02-16

input textなどの場合value値を使う

テキスト入力欄などのvalue値は「初期入力値」を表す

<input type="text" id="title" name="title" value="<?php echo $album['title'] ?>">

input radio(ラジオボタン)の場合は初期値はcheckedを使う

<input type="radio" name="card" id="spade" value="スペード" <?php echo ($player["spade"] === 'スペード') ? ' checked' : ''; ?>>
<label for="spade">スペード</label>
0
0
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
0
0