我有一個表單,最多可以添加6個子表單。因此,將有6套以下HTML:jQuery在同一超鏈接上顯示/隱藏不同組的表單元素
<table class="portletTable child" cellpadding="0" cellspacing="0" border="0" summary="Please enter some more details regarding your dependants">
<tr>
<th>
<label for="indTitle">Title</label>
</th>
<td colspan="3">
<select id="indTitle" class="inlineSpace">
<option value="Please select">Please select...</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Ms">Ms</option>
<option value="Miss">Miss</option>
<option value="Dr">Dr</option>
<option value="Other">Other</option>
</select>
<label for="indOther" class="inlineSpace">Other</label>
<input type="text" class="text" name="indOther" id="indOther" maxlength="20" />
</td>
</tr>
<tr>
<th>
<label for="firstname">First name</label>
</th>
<td colspan="3">
<input type="text" class="text" maxlength="50" value="" id="firstname" />
</td>
</tr>
<tr>
<th>
<label for="lastname">Last name</label>
</th>
<td colspan="3">
<input type="text" class="text" maxlength="50" value="" id="lastname" />
</td>
</tr>
<tr>
<th>
<label for="dobDay">Date of birth</label>
</th>
<td colspan="3">
<select name="dobDay" id="dobDay" class="inlineSpace">
<option value="day">Day</option>
</select>
<label for="dobMonth" class="offScreen">Month</label>
<select name="dobMonth" id="dobMonth" class="inlineSpace">
<option value="month">Month</option>
</select>
<label for="dobYear" class="offScreen">Month</label>
<select name="dobYear" id="dobYear">
<option value="year">Year</option>
</select>
<p class="fieldNote">You must be over 'minimum partner age' and under 'max partner age'</p>
</td>
</tr>
<tr>
<th>
Gender
</th>
<td colspan="3">
<input id="male" name="childGender" class="radio" type="radio" />
<label for="male" class="inlineSpace">Male</label>
<input id="female" name="childGender" class="radio" type="radio" />
<label for="female">Female</label>
</td>
</tr>
</table>
我需要第一個孩子顯示默認情況下,以下五個從視圖中隱藏。
當用戶點擊以下鏈接我希望第二個孩子來展示,如果他們點擊它然後再在第三個孩子的投入顯示等...顯示的第六個孩子時
<tr>
<th class="dependant">
<a href="" class="add">Add another child to your policy</a>
</th>
</tr>
顯然鏈接不應該顯示。
我還需要反向是真實的,用戶必須用這個超鏈接刪除最新添加的子選項:
<tr>
<th class="dependant">
<a href="" class="remove">Remove this child from your policy</a>
</th>
</tr>
如果關閉了JavaScript,然後一切都將默認顯示。
如果您有任何人可以提供幫助,請提前致謝。
我不喜歡這類問題。他們看起來像海報只是希望有人爲他做他的工作。爲什麼不看JQuery教程,下載並打印JQuery小抄,然後在遇到困難時詢問有關特定問題的問題? – 2010-02-18 13:16:38
LoL!...聽起來像功課嗎?你想要簡單嗎?... :) – Reigel 2010-02-18 13:22:01
嗨@喬希。 道歉我同意我有點懶惰。對不起,我會進一步調查,並在以後發生任何問題,當我不可避免地卡住。 – RyanP13 2010-02-18 13:23:27