我有一個包含多個文本字段的表單。如何禁用JavaScript中的表單中的一個字段?
在頂部的形式是兩個單選按鈕的一個問題:
去直接或上市。
轉到直接表示您必須提供一個電子郵件地址。
公開表示電子郵箱已禁用。
<input type="radio" name="target" value="public" /> <label for "public">Open to anyone </label></br> <input type="radio" name="target" value="direct"/> <label for="newEmail">Email address of the person:</label> <input type="text" name="newEmail" id='newEmail'> </br> </br> </br> <label for="title">Book title:</label> <input type="text" name="title" id='title'></br> <label for="location">Location:</label> <input type="text" name="location" id='location'>
任何其他形式字段必須受到影響
您使用的是ASP.net – Jegadeesh
不是,這是一個PHP設置 – Maxcot
當您選擇第二個選項時應該隱藏什麼? – sshow