Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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
 
Old November 25th, 2004, 03:25 AM
Authorized User
 
Join Date: Sep 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default blocking roundtrip javascript

Hi all......
                I am dev. a wed app. using ASp.NET in which i want to block a roundtrip to server caused by a selection on DDL with a javascript function if a certain condition fails....
                I used "window.event.returnValue = false" , but it is still going for a round trip. The script is fired on the "onchange" event....
                Is there any way to do this...Please help me....
                Thanks to all.......



 
Old November 25th, 2004, 05:03 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Add onsubmit event to the form.

Code:
onsubmit="return Validate()"
Code:
<script language="javascript">
    function Validate()
    {
        // Do Validation here and return true or false 
        return false;
    }
</script>
Now, for any submit, the post back will occour only if the validate method returns true.

Hope this helps...

Regards
Ganesh
 
Old November 26th, 2004, 07:37 AM
Authorized User
 
Join Date: Sep 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi r_ganesh76,
                  Thank u for the tip...It is working....

                                         :)

 
Old November 27th, 2004, 12:20 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Cheers :)

Regards
Ganesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
blocking of page in IE austinf Javascript 0 March 13th, 2007 08:23 AM
Blocking a process before it runs asidre Other Programming Languages 0 August 11th, 2006 01:35 AM
Locking / Blocking issues Anantsharma SQL Server 2000 0 January 6th, 2006 05:02 AM
Blocking in Sql Server whiterainbow SQL Server ASP 2 March 23rd, 2005 08:15 AM





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