を使用したjQuery検証スクリプトがありますjquery.validate.js
私が必要とするのは、ユーザーが [はい] を選択したときです - 追加情報が必要です (必須フィールド)。ユーザーが [いいえ] を選択した場合 - 続行します。
これを機能させるために長い間試みましたが成功しませんでした-追加
助けてくれてありがとう!
これが私のPHPコードです:
// If form type is radio, display as a radio button with yes/no answers
if ($form_type == 'radio')
{
echo "<input type=\"radio\" name=\"screen_184\" value=\"Yes\" checked /> <label>Yes</label> <input type=\"radio\" name=\"screen_184\" value=\"No\" /> <label>No</label><br /><br />";
// If from type is radio and additional information is required, display a textarea
if ($extra_info == 'Yes')
{
if ($row['required'] == 'Yes') {$class = 'required';} else {$class = 'input_field';}
echo "<textarea class=\"$class\" maxlegth=\"500\" name=\"screentext_184\" /></textarea></li><br /><br />\n";
}