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

Set focus and smart navigation

Hello Experts,

Currently I am writing a web application using vs.net 2002 with c#.

In a customer info page of the application, i have set the smart
navigation to true, so the application can go back to the same position
when postback occurs, and other reasons.
In the customer info page, when the user want to create a new customer
(user click the NEW button), i want the customer name textbox (first
field to enter) is on focus. Therefore the user dont have to hit tab all
the way the textbox. However, since smart nagviation is on, the last
click button (button NEW in this case) will set to focused, not the
customer name textbox i want.

my code is like this:

//c#
labelJavascript.Text =
"<script>setSelectFocus('customername');</script>";

// javascript
function setSelectFocus(field)
{
document.all[field].select();
document.all[field].focus();
}
can someone please tell me how can i overcome this problem?
thanks in advanced,

Benny

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 3520
While you click the NEW button, stored the TextBox name in a hidden field.
When post back the form, find the TextBox name from hidden field and set the
focus to that TextBox using JavaScript coding.

Regards,
Amal

"Benny" wrote:
Hello Experts,

Currently I am writing a web application using vs.net 2002 with c#.

In a customer info page of the application, i have set the smart
navigation to true, so the application can go back to the same position
when postback occurs, and other reasons.
In the customer info page, when the user want to create a new customer
(user click the NEW button), i want the customer name textbox (first
field to enter) is on focus. Therefore the user dont have to hit tab all
the way the textbox. However, since smart nagviation is on, the last
click button (button NEW in this case) will set to focused, not the
customer name textbox i want.

my code is like this:

//c#
labelJavascript.Text =
"<script>setSelectFocus('customername');</script>";

// javascript
function setSelectFocus(field)
{
document.all[field].select();
document.all[field].focus();
}
can someone please tell me how can i overcome this problem?
thanks in advanced,

Benny

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2
Hello AMAL,

I tried your suggstion, but didnt work. Can you please show me the
codes.
Cherrs,

Benny

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

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

Similar topics

20
by: Chris Bradbury | last post by:
Hi, I'm posting in this forum for the first time so if I break any conventions or protocols I'm sorry. I've attached this style: *:focus { outline: none } to a page but it doesn't remove...
20
by: Arne | last post by:
During testing <div style="overflow:auto;"> in CSS I noticed the mousewheel would work in Mozilla only after I made a <a href="#">some text</a> link and clicked on that, within the div. It...
6
by: anon | last post by:
How *EXACTLY* does Smart Navigation work? (I would really really really like for this Smart Navigation to work in Mozilla.) The inner workings and the code is what I am looking for. Does it...
0
by: Jason Rodman | last post by:
I have been working on a web app that uses IFrames for our edit screens. A main window contains static information, while an IFrame contains the editable page. I use javascript from the outer page...
1
by: Sal | last post by:
Greetings to all... I have a simple asp.net app. It consists of three aspx pages. I have enabled smart navigation on the pages. The app runs smoothly on the developer machine, but when I upload...
10
by: RodBillett | last post by:
Using SmartNavigation. Windows2003 Server Framework 1.0 (3705) IIS6 and I have IIS configured to utilize the 1.0 framework. Any Ideas why I would be getting the following jscript error within...
6
by: Mike | last post by:
I have a few textbox controls that have autopostback so that when they loose focus they update a label control that shows the count of characters in their respective text control. This works fine,...
1
by: thomson | last post by:
Hi all, i have enabled Smart Navigation in the Page attribute, My Webform has several Webform controls, all applied with style sheets from an external file. Problem --------- When a postback...
3
by: ajfish | last post by:
Hi, I have a web form with smart navigation turned on. the html has an onload event which calls a javascript function and the contents of this function are dynamically generated on the server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.