Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 March 15th, 2005, 08:55 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default Default Submit Button

Hi All,
What Is The Default Submit Button In The Page When It Have Many Server Control Buttons >

I Press Enter And I Can't Control The Default One.
Do Any Can Help ?????
<<<<<>>>>

Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old March 16th, 2005, 02:03 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

I am not sure which is the default submit button for the page.You can control the default button in javascript.Check for the enter key press and raise the button click event.

 
Old March 16th, 2005, 05:37 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

So I Should Do Client Side Function On Each Element On The Page To Catch The Enter Event!!!!!!!!

I Don't Think That The Easiest Solution?

Ahmed Ali
Software Developer
 
Old March 17th, 2005, 01:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I believe that HTML makes the first button on the page the default button, so if you change the order of the buttons to the one you want to be the default it should work.

If you want to keep the order of the buttons the same, then I think you will have to do as Santhi says and write a function to help the page figure it out.

J
 
Old March 17th, 2005, 01:09 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

No No...not for all the elements...Check for the enter key and raise the click event of whatever the button u want as default.

 
Old March 18th, 2005, 08:51 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

this code helps me
'''''
    <script>
    function swallowenter(){
        if(event.keyCode==13){
            event.keyCode=null;
            window.document.getElementById('Button2').click();
        }
        return true;
    }
    </script>
    <body MS_POSITIONING="GridLayout" onkeypress="javascript:swallowenter();">

'''''

Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a image button as default submit button toshi ASP.NET 1.0 and 1.1 Basics 1 June 1st, 2006 05:25 AM
Submit Button trusslady Infopath 2 January 6th, 2006 05:19 PM
Default (Submit) Web Form button sangata .NET Web Services 2 October 20th, 2004 02:03 AM
Submit Button Night_Zero Classic ASP Databases 1 August 17th, 2004 04:55 PM
multiple Image submit buttons set default to last sam HTML Code Clinic 2 June 30th, 2004 02:33 PM





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