Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 15th, 2005, 08:55 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
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
  #2 (permalink)  
Old March 16th, 2005, 02:03 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
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.

  #3 (permalink)  
Old March 16th, 2005, 05:37 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
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
  #4 (permalink)  
Old March 17th, 2005, 01:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
  #5 (permalink)  
Old March 17th, 2005, 01:09 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
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.

  #6 (permalink)  
Old March 18th, 2005, 08:51 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:37 AM.


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