473,322 Members | 1,405 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.

Focus after submit

Hello..

I have a problem with the focus that I had when the page reloaded, I
dont know how to do it. I have 2 option selected in my page, when I
select one option and the page automatic reload, and load the other
select with the information that I selected before, but the focus star
in the first field that is a Textbox, I want to still when I was before
the load done.

How I can do that?

thenks

Nacho

Jul 23 '05 #1
4 2756
In article <11**********************@g44g2000cwa.googlegroups .com>,
mi*********@yahoo.com enlightened us with...
Hello..

I have a problem with the focus that I had when the page reloaded, I
dont know how to do it. I have 2 option selected in my page, when I
select one option and the page automatic reload, and load the other
select with the information that I selected before, but the focus star
in the first field that is a Textbox, I want to still when I was before
the load done.

How I can do that?


body onload="document.formname.elementname.focus()"

If that doesn't answer your question, please be more clear and supply code or
a URL.

--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Hello Kaeli, thanks for your answer but that's not the question.. I'm
going to explain the problem..

I have a page with some textbox and option select and when i captured
the option select the second option select is loaded, but the setfocus
It goes to the first textbox that is in the page not in the select
option that I captured...

I hope had been explain...

Sorry for my english..

Nacho

Jul 23 '05 #3
In article <11*********************@f14g2000cwb.googlegroups. com>,
mi*********@yahoo.com enlightened us with...
Hello Kaeli, thanks for your answer but that's not the question.. I'm
going to explain the problem..

I have a page with some textbox and option select and when i captured
the option select the second option select is loaded, but the setfocus
It goes to the first textbox that is in the page not in the select
option that I captured...


If you're asking how to focus the select element when the page loads (instead
of the text element), that's what I posted.

If you are asking how to make one option of a select be the one that is
selected, it depends a bit on what you meant by "reloaded".
ASP.NET has controls that retain selections for you.
If you're using another server-side process to make the page, you do it on
the server-side.
If you're doing dynamic selects with all client-side javascript, this might
help you. It selects an option on page load. Modify it to suit your needs.

http://www.ipwebdesign.net/kaelisSpa..._parseUrl.html

I'm not here tomorrow or over weekends. If you need more help before Monday,
feel free to e-mail me.

--
--
~kaeli~
Local Area Network in Australia:... the LAN down under.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
If I understand the problem, it sounds like your page is losing state
whenever it is refreshed. You want it to look the way the user set
things before the refresh. So when you reload the page you need to
either pass the element id of the control you want to set focus to on
the URL, or keep the value in a hidden input field if you are doing a
post. When the page refreshes, you now have the information available
to you.

Does that help?

Jul 23 '05 #5

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

Similar topics

1
by: Robert Scheer | last post by:
Hi. I have a function to submit the form when my user types any character on a textbox. I call the function on the keyup event of the textbox. The function submits the form and set the focus on...
4
by: Nitin | last post by:
Hi I have created function to check date and time. at the time of execution, if date is left empty the function returns the error message but then the focus goes to next field. Next filed is for...
5
by: tshad | last post by:
I have a date validation function that I want to stay at the object I am validating if there is a Validation error, but it always goes to the next object. The Javascript: function...
2
by: ungvichian | last post by:
Okay, how do I write a page with a form so that when I click Submit, the following happens? 1. The data is submitted (of course) 2. The form is cleared (what I've tried results in the form being...
2
by: jw56578 | last post by:
Is there a reason why setting focus to a textbox input, also gives focus to a submit button on the page, to where if you click enter in the text box, the submit button will be clicked.
2
by: Pawel | last post by:
Hello All I have a submit button in my form. It gets focus (is activated by ENTER) everytime any text inputs are edited. So, if the user press ENTER before finishing all form, the form is...
0
by: Chris | last post by:
Hi, I have a dilemma. I have a web form that, when submitted, does a window.open js function to submit the form data to a new aspx page which then shows a report. I wanted to make sure that...
2
by: barry | last post by:
I was wondering why on a webform when I put the cursor into a textbox the focus goes to the only button on the form. thanks
4
by: Johannes Kiehl | last post by:
Hi group, I've been losing most of my remaining hair today, trying to track down a problem with IE6.0 (builds: .2600 and XP SP 2). I set the border-width of form input fields to 1px via...
8
by: Nivetha | last post by:
I have requirement like the first page contains LoginName and CompanyName after typing the value clicking Submit button so i am giving in body onload="document.forgotPassword.loginName.focus();...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.