2011-05-16 3 views
0

안녕하세요 테이블 열 중 하나를 만든 테이블 열은 확인란과 기타 데이터입니다. 이제는 전체를 보낼 수있는 확인란을 사용하여 단일 값을 게시 할 수있는 방법을 알고 있습니다. 행 즉, 사용자가 체크 박스 ID, 제목, 설명 ....... REQ 수량 checkbox 선택하고 모든 과정에 따라하는 서블릿 검사에서 서블릿여러 값을 보내려면 확인란을 사용하십시오.

<table border="1" cellpadding="6" cellspacing="4" 
     style="border-collapse: collapse" width="200%" id="AutoNumber1" 
     align="center" bordercolorlight="#800000" bordercolordark="#800000 " class="left" > 
    <tr> 
     <td width="5%" align="center"> 
      <input type="checkbox" id=checked" value=<%= id%>/> 
      <font face="Arial" size="3" color="light blue"> 
      Options</font> 
     </td> 
     <td width="15%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Title</font> 
     </td> 
     <td width="40%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Description</font> 
     </td> 

       <td width="15%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Company</font> 
     </td> 
     <td width="10%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Province</font> 
     </td> 
      <td width="10%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      District</font> 
     </td> 
      <td width="10%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Actual Quantity</font> 
       </td> 
     <td width="10%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Required Quantity</font> 

     </td> 
    </tr> 
</table> 
+0

귀하의 질문이 나 –

+0

@Jigar에 명확하지 않다, checkbox_2에 대해 같은 논리를 적용 할 수 있습니다. –

+0

@ahsan @Harry가 올바른 경우 모든 것을 폼에 넣고 체크 박스가 선택된 행을 처리합니다. –

답변

0

에 게시됩니다 확인할 때 다른 데이터. 당신의 HTML이 보이는 경우 예컨대, : 서블릿보다

<table border="1" cellpadding="6" cellspacing="4" 
     style="border-collapse: collapse" width="200%" id="AutoNumber1" 
     align="center" bordercolorlight="#800000" bordercolordark="#800000 " class="left" > 
    <tr> 
     <td width="5%" align="center"> 
      <input type="checkbox" id="checkbox_1" value=<%= id%>/> 
      <font face="Arial" size="3" color="light blue"> 
      Options1</font> 
     </td> 
     <td width="15%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Title</font><input id="title_1" /> 
     </td> 
     <td width="40%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Description</font><input id="description_1" /> 
     </td> 

    </tr> 
     <tr> 
     <td width="5%" align="center"> 
      <input type="checkbox" id="checkbox_2" value=<%= id%>/> 
      <font face="Arial" size="3" color="light blue"> 
      Options2</font> 
     </td> 
     <td width="15%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Title</font><input id="title_2" /> 
     </td> 
     <td width="40%" align="center"> 
     <font face="Arial" size="3" color="light blue"> 
      Description</font><input id="description_2" /> 
     </td> 

    </tr> 
</table> 

, 선택 checkbox_1 여부를 확인? 예인 경우 title_1description_1입니다. 지금까지 내가 이해 영업 이익은 체크 박스가 선택되어있는 전체 행 데이터를 제출하고 싶어 : 그리고 title_2 & description_2

+0

문제는 전체 테이블이 데이터베이스에서 채워지는 것입니다 그리고 나는 완전히 동적이기 때문에 나는 위의 shceme이 적합하다고 생각한다. – ahsan

+0

나는 이것을 사용하여 HTML 페이지에서 인쇄하기 위해 json을 사용하고있다. id '에 대한 체크 박스 [id]와 제목에 대한 체크 박스 [id] [name]은 – ahsan

+0

@ahsan으로 작동합니다. 방금 전 아주 기본적인 생각을했습니다. 요구 사항에 따라 조정해야합니다. –

관련 문제