簡體   English   中英

如何使表格內容以彈出形式自動顯示

[英]how to make the table content wil shown automaticly in pop up form

我試圖在我的網站上做一張桌子。 表內容具有我在下一步操作中用作參數的值,並自動在表單上顯示。 這是我的skenario

表格的內容作為我的彈出窗口的按鈕,像這樣

  <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>

這是我的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>

我的焦點問題是如何使表格內容自動在Posisi大廳以彈出形式顯示。 例如:當用戶點擊“ A1.4”時,“ posisi”對話框中的值自動顯示為A1.4

然后,當用戶單擊查看按鈕時,“ Web”將引導用戶進入一個新頁面,該頁面顯示了數據庫,其中表內容作為參數。 可能是http://jsfiddle.net/andricoga/k4BB3/#base可以幫助您了解我的問題

我的英語水平仍然很弱,希望您能理解我的意思並為我解決

是的,我發現

<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/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM