如何让表格内容以弹出的形式自动显示 [英] how to make the table content wil shown automaticly in pop up form

查看:86
本文介绍了如何让表格内容以弹出的形式自动显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着在我的网上做一张桌子。表格内容具有我在下一个操作中用于参数并自动显示在表单上的值。
在这里我的skenario



表格的内容作为我的弹出窗口的按钮

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

这是我的popup_window_show

 < div class =popup_window_cssid =sample> 
< div class =popup_window_css_head>< img src =images / close.gifalt =width =9height =9/> Aksi< / div>
< div class =popup_window_css_body>< div style =border:1px solid#808080; padding:6px; background:#FFFFFF;>
< form method =postaction =>
< 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>产品ID:< / td>
< td> < input type ='text'name =id/>< / td>
< / tr>
< tr>
< td>产品名称:< / td>
< td> < input type ='text'name =nama/>< / td>
< / tr>
< tr>
< td>生产日期:< / 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 coloumn的弹出窗口自动显示。
ex:当用户clik A1.4所以在posisicoloumn中自动获得值A1.4并显示

然后当用户点击查看按钮时, web引导用户到一个显示数据库的表格内容为参数的新页面。
可能是这个 http://jsfiddle.net/andricoga/k4BB3/#base可以帮助理解我的问题



我的英语还很弱,我希望你明白我的意思,并给我解决tq

解决方案

是的,我发现

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

< input type =buttononclick =setvalue(this.value); value =A1.8/>
< / td>
< / tr>
< / table>
< / div>
< div class =popup_window_cssid =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.gifalt =width =9height =9/> Aksi< / div>
< div class =popup_window_css_body>
< div style =border:1px solid#808080; padding:6px; background:#FFFFFF;>
< form method =postaction =>
< table>
< tr>
< td> Werehouse< / td>
< tr>
< td> Posisi< / td>
< td>
< input type ='text'name =pid =posisi/>
< / td>
< / tr>
< tr>
< td>产品ID< / td>
< td>
< input type ='text'name =id/>
< / td>
< / tr>
< tr>
< td>产品名称< / td>
< td>
< input type ='text'name =nama/>
< / td>
< / tr>
< tr>
< td>生产日期< / 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/


i try to make a table in my web. Table content have value that i use for parameter in the next action and automaticly shown on form. here my skenario

the content of the table as button for my popup like this

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

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

my focus problem how to make the table content will shown automaticly in popup form at Posisi coloumn. ex: when the user clik A1.4 so in "posisi" coloumn automaticly have value A1.4 and displayed

And then when user click view button, "web" guide the user to a new page that displayed database which table content as parameter. may be this http://jsfiddle.net/andricoga/k4BB3/#base can help to understand my problem

my english still weak, i hope you understand what i mean and give solve for me tq

解决方案

yes i find that

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

you can cek here http://jsfiddle.net/JLExZ/

这篇关于如何让表格内容以弹出的形式自动显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆