如何自动加载数据添加到数据库中的记录 [英] How to load datas automatically the records added on database

查看:102
本文介绍了如何自动加载数据添加到数据库中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是库存系统.在我的购买表单中,有[货仓],[计数器]字段.
在下拉列表中.客户问我,如果仓库在列表中不可用,我们一次创建.因此,我给了在新选项卡中打开创建仓库"表单的超链接.因此,他们正在创建仓库.但是,当新的货品添加到数据库中时,新的货品名称将自动添加到销售表单货品列表中.但是现有的给定字段,例如我们给客户的名称,数量不变.怎么做.以及如何在Web应用程序中使用快捷键.请帮我.感谢U.

My project is inventory systems. In my purchase form there are Godown, Counter fields.
Which is in Dropdownlist. The client asked me, If the godown is not available in list, we are creating at a time. So I give the hyperlink which is open Create godown form in new tab. So they are creating godown. But When the new godown is added in database, the new godown name is automatically added to sales form godown list. But the existing given fields, such as we are giving customer name , amount is not changed. How to do it. And How to using shortcutkeys in webapplications. Please help me. Thanking U.

推荐答案

的数据填充错误,请在打开页面时填写下拉列表.或按照RDBurmon的评论进行.现在,我为您提供了如何使用js使用快捷键的解决方案.

for data filling error fill the dropdownlist on when you open page. or do as per the comments of RDBurmon. now i am giving you solution how to use shortcut keys by using js.

<body onkeypress="HotKeyClick();">
<asp:button id="Btn" accesskey="x" xmlns:asp="#unknown" /></body>


在js中添加此js函数


in js add this js function

function HotKeyClick()
{
    if(event.srcElement.type == 'text' || event.srcElement.type == 'textarea' || event.srcElement.type == 'select') return true;

    var ArrButtons = document.getElementsByTagName('input');

    for(var Count=0; Count < ArrButtons.length; Count++)
    {
        if(ArrButtons[Count].type == 'submit')
        {
            if(ArrButtons[Count].accessKey != null)
            {
                var keyChar = new String(String.fromCharCode(event.keyCode));
                var acsChar = new String(ArrButtons[Count].accessKey);

                if(keyChar.toUpperCase() == acsChar.toUpperCase())
                {
                    if (ArrButtons[Count].disabled == false)
                    {
                        ArrButtons[Count].focus();
                        ArrButtons[Count].click();
                        break;
                    }
                }
            }
        }
    }
}


这篇关于如何自动加载数据添加到数据库中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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