473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Linking text boxes to buttons.

Is there anything builtin to ASP.net that allows you to tie a text box to a
button so when you press enter in the text box it emulates clicking a near
by button.

I've coded up some client side javascript that does this, but it fails when
their is a validator monitoring the text box (in firefox, but that's 10% of
my visitors).
Jan 23 '06 #1
1 1597
Hi Joel,

Welcome to ASPNET newsgroup.
Regarding on the TextBox's on enter key press and button's submitting, so
far there is no such buildin setting to associate them. And the problem on
using some custom client scrpit together with validation controls on
textbox does exists, this is actually related to the client validation
script which is called in the form's onsubmit event that occur after our
clientside onkeydown scrpit but before the form to be submit .... So
far, I'm afraid it would be hard to avoid it if we just use the textbox's
clientside "onkeydown" event to perform certain button's clicking(when
client validation is turned on....).

If you do need to use some custom script when client validation turn on,
one possible approach is do not make the submit button cause validation by
default but use some clientscript to manually call the clientside
validation function. You can view the html source for the asp.net page (use
valiation control and turn on clientside validation) in browser and find
the validation script's linked resource file like:

<script
src="/StevenRoot/Whidbey/WebSites/Test/WebResource.axd?d=nyC9UwOMc5RFmmFNmpq
nDtiUIx-5Dflmy7nzRpCO8Wg1&amp;t=632665397732419488"
type="text/javascript"></script>
After download it and open in text editor, we can view all the underlying
validation script functions which we can manuall invoke through our own
script code....

And the above is for asp.net 2.0's case, while for asp.net 1.1, you can
refer to the following msdn article on the validation's underlying details:

#ASP.NET Validation in Depth
http://msdn.microsoft.com/library/en...id.asp?frame=t
rue

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Joel Barsotti" <jo**********@nospam.nospam>
| Subject: Linking text boxes to buttons.
| Date: Mon, 23 Jan 2006 14:50:53 -0800
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#m**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: static-70-104-252-225.ptldor.dsl-w.verizon.net
70.104.252.225
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:372994
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Is there anything builtin to ASP.net that allows you to tie a text box to
a
| button so when you press enter in the text box it emulates clicking a
near
| by button.
|
| I've coded up some client side javascript that does this, but it fails
when
| their is a validator monitoring the text box (in firefox, but that's 10%
of
| my visitors).
|
|
|

Jan 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Megan | last post by:
hi- i have a table, case, that i'm to normalize. for example, the table, case, has the following fields- caseid = primary key issue1 = number issue1desc = text issue2 = number
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
1
by: hartman | last post by:
I have seen things to link list boxes and/or combo boxes to forms such that when you select an item in the list (or combo) box the form moves to the matching record. One example (by Allen...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have posted a couple times on here already and found the user community to be very helpful. I took on a project before I realized how difficult a time I'm having working with a database....
2
by: DataSmash | last post by:
Hello, I've created a simple form with 2 radio boxes, 2 text boxes and a button. When I click the button, I'd like to write each "choice" to a text file. I can't figure out how to "link" the...
2
by: SREDWORB | last post by:
Hello, Try to explain this as best as I can. I have a main form with several cmd buttons, (Not interested in subforms for this project) that opens popup forms. Example: Main form frmPerson,...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
9
by: RICHARD BROMBERG | last post by:
Please bear in mind that I am a newbie. I am posting this question a second time because the responses to my earlier post were a little wide of the mark. So, here goes: I am using Access 2000...
1
by: stewdizzle | last post by:
I have a from with three radio buttons (same group) and three text boxes. The radio buttons give the user a choice of uploading one, two, or three images. Currently, I have the text boxes load as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.