Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > Other Programming Languages
|
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 21st, 2008, 03:08 PM
Registered User
 
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Avoid postback when a ComboBox is clicked

Hi All,

I have a custom Control which contains div as a main container and any other control can be dragged and dropped within the div control. Currently, I have added client side code to invoke a postback on the following events of the container:
        document.onchange = handleEvent;
        interceptor.onclick = handleEvent;
        interceptor.onkeypress = handleEvent;
        interceptor.onkeyup = handleEvent;
        interceptor.onpaste = handleEvent;

So in any of these events on the container or any its child a postback event is raised to the server with the function handleEvent:

function handleEvent(event)
 {
    var btsave = document.getElementById(controlEtatUpdate);

    if ( btsave.disabled )
    {
        if (!event)
        {
            var e = window.event;
            if (!e.ctrlKey)
            {
                if (e.keyCode != Sys.UI.Key.tab)
                {
                    if (e.srcElement.type) {
                        if (e.srcElement.type == 'text')
                        {
                            if (e.type != 'click')
                            {
                                // Save the current position for a text.
                                currentPosition = getPosition(e.srcElement)

                                WarnServer();
                            }
                        }
                        else
                        {
                            WarnServer();
                        }

                        //W3C model
                        if (e.stopPropagation)
                        {
                            e.stopPropagation();
                        }
                    }
                }
            }
        }
    }
}


So as soon you click on the custom control, an even is raised but I would like to avoid that in the case of a ComboBox…Especially when there is no change in the selection. Any help will appreciated.


Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoid enter data from keyboard into combobox mona_upm84 Excel VBA 1 September 5th, 2008 01:26 AM
avoid postback using ajax in javascript kalyanykk Visual Studio 2005 1 May 30th, 2008 08:16 AM
How to know whick button was clicked. KingArthur Struts 1 February 22nd, 2006 07:12 AM
How to tell which button clicked emily PHP How-To 2 November 30th, 2004 01:35 PM
Refresh a combobox without postback Eddy ASP.NET 1.x and 2.0 Application Design 1 March 10th, 2004 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.