2012-08-14 105 views
0

我有一種表單,它處於jsp狀態,用戶單擊查看錶單。當表單呈現時,表單中包含的信息不應該是可編輯的,所有的td都應該是可見的,但不應該是可編輯的。如何使用css禁用jsp中的所有td標記

例如: -

<table width="600" align="center" > 
        <tr> 
         <td class="td_left_b" width="30%">Company Name:</td> 
         <td width="60%" height="25"><input type="text" size="28" value="${com.companyName}" id="companyName"/></td> 
        </tr> 
        <tr> 
         <td class="td_left_b" width="30%">Hotel Name(Display Name):</td> 
         <td width="60%" height="25"><input type="text" size="28" value="${com.hotelName}" id="hotelName"/></td> 
        </tr> 
        <tr> 
         <td class="td_left_b" width="30%">Country:</td> 
         <td width="60%" height="25"><input type="text" size="28" value="" id="country"/></td> 
        </tr> 
        <tr> 
        <td class="td_left_b" width="30%">City:</td> 
        <td width="60%" height="25"><input type="text" size="28" value="${com.cityName}" id="cityName"/></td></tr> 
        <tr> 
         <td class="td_left_b" width="30%">NeighbourhoodName:</td> 
         <td width="60%" height="25"><input type="text" size="28" value="${com.neighbourhoodName}" id="neighbourhoodName"/></td> 
        </tr> 
        <tr> 
         <td class="td_left_b" width="30%">Street Name:</td> 
         <td width="60%" height="25"><input type="text" size="28" value="${com.streetName}" id="streetName"/></td> 
        </tr> 
</table> 

的上述信息我正在通過彈簧模型屬性中各自TD推杆。我不想被編輯的信息。 謝謝。

+1

這與JSP無關。請提供HTML,並告訴我們您嘗試過的內容。 – 2012-08-14 05:46:26

+0

你可能在JavaScript或Jquery中犯了錯誤。 – Sandy8086 2012-08-14 05:52:00

回答

0

您不能禁用表列。你必須禁用表中的evere輸入。

+0

你的意思是在每個td我需要添加禁用atttribute。 – ASUR 2012-08-14 05:54:17

+0

您無法禁用td's。您必須禁用INPUT-Tags(輸入數據的位置)和disabled-attribute。 – rollstuhlfahrer 2012-08-14 06:02:49