473,322 Members | 1,736 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,322 software developers and data experts.

How to force a click on ASP.Net Button

Hi,

I have a webpage that has 2 ASP.Net buttons as well as some other
controls. The controls are split up into two, there is a set of Combo
boxes and then there is a single text input box. The controls are
seperated by DIV's to create a TABView. So when clicking on the 1st tab
will show the combo boxes and a button, the second tab will show a text
box and a button.

What I would like is for these buttons to be the default dependant on
which tab was selected. I have managed to find what tab is clicked, but
I need to know how I can set focus on a specified ASP.Net button.

Any ideas. You can view the site: http://www.kitchensink.co.za.

Thanx

Jun 6 '06 #1
1 17243
Hi,

here's how to "simulate" a button click:

document.forms[0].MyButton.click();

here's for example in an anchor tag:

<a href="javascript:document.forms[0].MyButton.click();">simulate
button click</a>

Also you may use the onkeypress event for the textbox:

<input type=text size=50 class="input_small" id=txtKeyword
name=txtKeyword onkeypress="if(event.keyCode==13){
doSearch(this.value); return false; }" >

Another solution would be to disable the button on the first tab when
the second one is active and vice versa.

Hope this helps,
Nikolay


Bu******@gmail.com написа:
Hi,

I have a webpage that has 2 ASP.Net buttons as well as some other
controls. The controls are split up into two, there is a set of Combo
boxes and then there is a single text input box. The controls are
seperated by DIV's to create a TABView. So when clicking on the 1st tab
will show the combo boxes and a button, the second tab will show a text
box and a button.

What I would like is for these buttons to be the default dependant on
which tab was selected. I have managed to find what tab is clicked, but
I need to know how I can set focus on a specified ASP.Net button.

Any ideas. You can view the site: http://www.kitchensink.co.za.

Thanx


Jun 6 '06 #2

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

Similar topics

6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
3
by: xscully | last post by:
Is there a way to force the user to read a textarea? Just like those 'agreements' that is used in a few offline instalation.. You have to scroll all the way down of the textarea and then the I...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
5
by: Selden McCabe | last post by:
I have a page that displays a picture. In the page load I figure out which image and then do a StudentPicutre.imageurl = <some file name> But if you use the browser's back button, enter...
8
by: Amirallia | last post by:
Hello I want to force the Page.IsPostBack to false when I click an "asp:button" Is it possible ? -- Ceci est une signature automatique de MesNews. Site : http://www.mesnews.net
8
by: Keith H | last post by:
I'm looking for a way to force the user to re-authenticate with their Windows username/password/domain after clicking the submit button on an ASP.NET page. This is for an internal application. ...
0
by: comp.lang.php | last post by:
I have a form that when you click the "Generate Report" submit button, it will force download a CSV file, required for this project. On the very same page you also have a "Search" submit button,...
2
by: =?Utf-8?B?U2lsa0NpdHlGbG9yaWRh?= | last post by:
I have a web page "PgA" with a GridView. I open another page "PgB" in a new window. On PgB, they do some things that affect the underlying data for the GridView on PgA. When the user is done...
4
by: anudu | last post by:
hi, im dveloping a web system using vs 2008. in my page i have a ajax page method wich is called by javascript function . in onsuceeded method i want to force the save button on my page to be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.