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

Focus on previously selected page

Hell,

I have a web page in which I have different tab/divs. So when the
user selects different tabs the the url changes to

http://localhost/db/adminconsole.php#Page_1
http://localhost/db/adminconsole.php#Page_2
http://localhost/db/adminconsole.php#Page_3

What I am trying to do is reset the focus on the currently selected
tab when the form is submitted. For instance, when the user make a
selection in a form it always return the url to http://localhost/db/adminconsole.php

How can I trap the current url and set it have running the rest of my
code to save/delete/...?

Thank you,

QB
Jun 2 '08 #1
4 1252
On Tue, 13 May 2008 13:48:36 +0200, <qu**********@hotmail.comwrote:
Hell,

I have a web page in which I have different tab/divs. So when the
user selects different tabs the the url changes to

http://localhost/db/adminconsole.php#Page_1
http://localhost/db/adminconsole.php#Page_2
http://localhost/db/adminconsole.php#Page_3

What I am trying to do is reset the focus on the currently selected
tab when the form is submitted. For instance, when the user make a
selection in a form it always return the url to
http://localhost/db/adminconsole.php

How can I trap the current url and set it have running the rest of my
code to save/delete/...?
By javascript, not with PHP alone (the fragment isn't even sent to the
server AFAIK). Probably you'll have to set a cookie with javascript on
changes & load time, and then either act accordingly with PHP's output
(set a particular div visbile, the rest hidden/display:none), or do that
with javascript after the pageload.
--
Rik Wasmus
[SPAM] Now temporarily looking for some smaller PHP/MySQL projects/work to
fund a self developed bigger project, mail me at rik at rwasmus.nl. [/SPAM]
Jun 2 '08 #2
On 13 May, 12:59, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Tue, 13 May 2008 13:48:36 +0200, <question....@hotmail.comwrote:
Hell,
I have a web page in which I have different tab/divs. So when the
user selects different tabs the the url changes to
http://localhost/db/adminconsole.php#Page_1
http://localhost/db/adminconsole.php#Page_2
http://localhost/db/adminconsole.php#Page_3
What I am trying to do is reset the focus on the currently selected
tab when the form is submitted. For instance, when the user make a
selection in a form it always return the url to
http://localhost/db/adminconsole.php
How can I trap the current url and set it have running the rest of my
code to save/delete/...?

By javascript, not with PHP alone (the fragment isn't even sent to the
server AFAIK). Probably you'll have to set a cookie with javascript on
changes & load time, and then either act accordingly with PHP's output
(set a particular div visbile, the rest hidden/display:none), or do that
with javascript after the pageload.
As a general rule I'd avoid using cookies for transferring information
explicitly between one page and the next - rather I only use cookies
for session related data or user related data. My prefered solution
would be to use a hidden form field. However the cookie approach dose
mean that the entire behaviour can be encapsulated with javascript if
POSTs are used.

C.
Jun 2 '08 #3
On May 13, 8:07*am, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@gmail.comwrote:
On 13 May, 12:59, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:


On Tue, 13 May 2008 13:48:36 +0200, <question....@hotmail.comwrote:
Hell,
I have a web page in which I have different tab/divs. *So when the
user selects different tabs the the url changes to
>http://localhost/db/adminconsole.php#Page_1
>http://localhost/db/adminconsole.php#Page_2
>http://localhost/db/adminconsole.php#Page_3
What I am trying to do is reset the focus on the currently selected
tab when the form is submitted. *For instance, when the user make a
selection in a form it always return the url to
>http://localhost/db/adminconsole.php
How can I trap the current url and set it have running the rest of my
code to save/delete/...?
By javascript, not with PHP alone (the fragment isn't even sent to the
server AFAIK). Probably you'll have to set a cookie with javascript on
changes & load time, and then either act accordingly with PHP's output
(set a particular div visbile, the rest hidden/display:none), or do that
with javascript after the pageload.

As a general rule I'd avoid using cookies for transferring information
explicitly between one page and the next - rather I only use cookies
for session related data or user related data. My prefered solution
would be to use a hidden form field. However the cookie approach dose
mean that the entire behaviour can be encapsulated with javascript if
POSTs are used.

C.- Hide quoted text -

- Show quoted text -
I was playing around with an onclick event for the tab to populate the
url into an input control. For some reason, all the data from my
other control gets posted but not this one control with the url? So I
came here to ask the question. There wouldn't happen to be an example
somewhere I could inspire myself from?

QB
Jun 2 '08 #4
On Tue, 13 May 2008 14:17:31 +0200, <qu**********@hotmail.comwrote:
On May 13, 8:07*am, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@gmail.comwrote:
>On 13 May, 12:59, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Tue, 13 May 2008 13:48:36 +0200, <question....@hotmail.comwrote:
Hell,
I have a web page in which I have different tab/divs. *So when the
user selects different tabs the the url changes to
>http://localhost/db/adminconsole.php#Page_1
http://localhost/db/adminconsole.php#Page_2
http://localhost/db/adminconsole.php#Page_3
What I am trying to do is reset the focus on the currently selected
tab when the form is submitted. *For instance, when the user make a
selection in a form it always return the url to
http://localhost/db/adminconsole.php
How can I trap the current url and set it have running the rest of
my
code to save/delete/...?
By javascript, not with PHP alone (the fragment isn't even sent to the
server AFAIK). Probably you'll have to set a cookie with javascript on
changes & load time, and then either act accordingly with PHP's output
(set a particular div visbile, the rest hidden/display:none), or do
that
with javascript after the pageload.

As a general rule I'd avoid using cookies for transferring information
explicitly between one page and the next - rather I only use cookies
for session related data or user related data. My prefered solution
would be to use a hidden form field. However the cookie approach dose
mean that the entire behaviour can be encapsulated with javascript if
POSTs are used.
And a GET still works with cookies.
I was playing around with an onclick event for the tab to populate the
url into an input control. For some reason, all the data from my
other control gets posted but not this one control with the url? So I
came here to ask the question. There wouldn't happen to be an example
somewhere I could inspire myself from?
If you populate a form field with a value, and you submit that form, it
should be there. If that doesn't work, checking what actually happens with
a combination of FireBug (for the DOM changes) and LiveHTTPHeaders (for
the actual POSTs/returns), which are a quick way to find the problem.
However, if the url is in a field and doesn't make it to the server, the
problem is 99% sure with the javascript involved, and definitely not PHP.
--
Rik Wasmus
[SPAM] Now temporarily looking for some smaller PHP/MySQL projects/work to
fund a self developed bigger project, mail me at rik at rwasmus.nl. [/SPAM]
Jun 2 '08 #5

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

Similar topics

3
by: Dai Ba Wong | last post by:
Hi: Currently I am having a problem with my webpage. My page consist of two frames, one consist of input text field and the other contains link for different pop-up windows. The problem...
2
by: Marco Liedekerken | last post by:
Hi, Is it possible to retrieve the control that had the focus when the page was posted back? Because the focus is lost when a postback occurs I want to manually set the focus to the control...
5
by: Glenn T. Kitchen | last post by:
Hello All, Does anyone know how to set the focus to a textbox control on Page_Load? Thank you, Glenn
0
by: LCAdeveloper | last post by:
Another newbie question I'm afraid. When I use the .Focus() or .Select() methods to set the initial control that has focus on a form, try as I might I cannot get the control to visually indicate...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
1
by: danyeungw | last post by:
I get the following from the link http://support.microsoft.com/kb/314206. I need to have both work - the page stays where it is and set focus to next control. Does anyone have solution? I have...
6
by: probashi | last post by:
Hi, Issue: After post back selected item of a list box is getting out of focus (when it contains more items than it's size). I have a List Box in an ASPX page. I select an item from the...
1
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I have a tab control and when I access a tab page I'd like to focus on a textbox. I am using someTextBox.Focus() on tabPage_Enter() event, but it is not focusing in the someTextBox. ...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.