2013-03-30 3 views
1

나는 내 웹에 테이블을 만들려고합니다. 표 내용은 다음 작업에서 매개 변수로 사용하는 값을 가지며 양식에 자동으로 표시됩니다. 여기이테이블 내용을 팝업 형식으로 자동 표시하는 방법

<div> 
    <table width="1023" height="248" border="1"> 
     <tr> 
     <th colspan="2" scope="col">A1</th> 
     <th colspan="2" scope="col">A2</th> 
     <th colspan="2" scope="col">A3</th> 
     </tr> 
     <tr> 
     <td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A1.4" /></td> 
     <td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A1.8" /></td> 
     <td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A2.4" /></td> 
     <td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A2.8" /></td> 
     <td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A3.4" /></td> 
     <td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A3.8" /></td> 
    </tr> 
</div> 

처럼 내 팝업을위한 버튼과 테이블 내 skenario

내용이 내 popup_window_show 방법 테이블 내용을 만드는

<div class="popup_window_css" id="sample"> 
    <div class="popup_window_css_head"><img src="images/close.gif" alt="" width="9" height="9" />Aksi</div> 
    <div class="popup_window_css_body"><div style="border: 1px solid #808080; padding: 6px; background: #FFFFFF;"> 
    <form method="post" action=""> 
    <table width="200"> 
     <tr> 
     <td colspan='2' align='center'> WHK </td> 
     <tr> 
     <td> Posisi :</td> 
     <td> <input type='text' name="p" /></td> 
     </tr> 
     <tr> 
     <td> Product ID :</td> 
     <td> <input type='text' name="id" /></td> 
     </tr> 
     <tr> 
     <td> Product Name :</td> 
     <td> <input type='text' name="nama" /></td> 
     </tr> 
     <tr> 
     <td> Production Date :</td> 
     <td> <input type='text' name="tgl" /></td> 
     </tr> 
     <tr> 
      <td colspan='2' align='right'> 
      <input type='submit' value= 'Save'> 
      <input type='reset' value='Reset' /> 
      <input type='button' value='view' onclick=\"window.location.href='#';\"/> 
      </td> 
     </tr> 
    </table> 
    </div> 
</div> 

내 초점 문제를 automaticly에 표시됩니다 Posisi coloumn의 팝업 양식. 예 : 사용자가 A1.4를 "posisi"에서 자동으로 값을 A1.4로 표시 할 때

그리고 나서 사용자가보기 버튼을 클릭하면 " 표 내용을 매개 변수로 사용합니다. 이 http://jsfiddle.net/andricoga/k4BB3/#base 내 문제를 이해하는 데 도움이 될 수있다

내 영어 여전히 약한, 난 당신이 무슨 뜻인지 이해하고 TQ 나를 위해 해결 줄 희망

답변

1

그래, 난 찾아 그

<script> 
     function setvalue(values) { 
     document.getElementById('posisi').value = values; 
    } 
    </script> 
    <div> 
     <table width="1023" height="248" border="1"> 
      <tr> 
       <td> 

         <input type="button" onclick="setvalue(this.value);" value="A1.8" /> 
       </td> 
      </tr> 
     </table> 
     </div> 
     <div class="popup_window_css" id="sample"> 
      <table class="popup_window_css"> 
       <tr class="popup_window_css"> 
        <td class="popup_window_css"> 
         <div class="popup_window_css_head"> 
          <img src="images/close.gif" alt="" width="9" height="9" />Aksi</div> 
         <div class="popup_window_css_body"> 
          <div style="border: 1px solid #808080; padding: 6px; background: #FFFFFF;"> 
           <form method="post" action=""> 
            <table> 
             <tr> 
              <td>Werehouse</td> 
              <tr> 
               <td>Posisi</td> 
               <td> 
                <input type='text' name="p" id="posisi" /> 
               </td> 
              </tr> 
              <tr> 
               <td>Product ID</td> 
               <td> 
                <input type='text' name="id" /> 
               </td> 
              </tr> 
              <tr> 
               <td>Product Name</td> 
               <td> 
                <input type='text' name="nama" /> 
               </td> 
              </tr> 
              <tr> 
               <td>Production Date</td> 
               <td> 
                <input type='text' name="tgl" /> 
               </td> 
              </tr> 
              <tr> 
               <td colspan='2' align='right'> 
                <input type='submit' value='Save'> 
                <input type='reset' value='Reset' /> 
                <input type='button' value='view' onclick=\ "window.location.href='#';\"/> 
               </td> 
              </tr> 
            </table> 
          </div> 
         </div> 

당신이 할 수있는 여기에 http://jsfiddle.net/JLExZ/

+0

hahahahah .... 당신은 마침내 그것을 발견합니다. – newbie

관련 문제