Click here to Skip to main content
16,009,598 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
RDBurmon 1-Jun-12 6:51am    
Hello OP ,
It seems that you are using different-different gridview to display data but after adding new godown details you are refreshing only one list not the other.Please check in this way.

1 solution

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.

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

in js add this js function

C#
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;
                    }
                }
            }
        }
    }
}
 
Share this answer
 
Comments
devausha 14-Jun-12 3:06am    
Thank u for ur reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900