I
iwearwatches
Group,
What a root canal.
Here is what I have:
I have a page that has several layers that I will either show/hide
based on a graphic/tab that the user clicks. (works perfectly)
On several of the layers there are forms that the user can update
information on. Well, after the user updates the information, I need
to 1.) refresh the data on the page(means a reload of the page), and
2.) take the user right back to were they started.
My problem is that when I refresh, the page goes back to the 1st layer
that is set as default to show.
So, here is what I did. I have two functions.
Function 1 is called when the user clicks on one of the tabs (Assets)
in this case. This will 1.) show the Assets tab and 2.) hide all the
rest of the tabs.
Well if I update that form for Assets, I need to 1.) refresh the data
and 2.) bring the user right back to Assets.
What I did for this (please tell me if there is a better way) was to
set a hidden field with the lastlocation of where the user clicked. In
this case the field value is now set to Assets.
So far everything is working great...
Well, if I submit the form because I've updating information, I need to
return back to the assets layer. To do this I set the location.url and
put a var in the url that I evaluate when I OnLoad the page. If the
value = Assets then I am able to show/hide the layers to get to the
Assets.
Again, this works great after much banging of my head against the
wall... Here come the problem.
Because I set the location.URL (I've also tried location.href) the
browser will automatically refresh. I do not want this. I want to set
the url and only refresh when I want to.
For example when I submit a form that updates data.
Help - How do you set the URL (using Javascript) and not have the page
refresh automatically? I've tried also trying to set the header, but I
can't with javascript.
I'm really stuck - Thank you in advance for your thoughts.
Terry
What a root canal.
Here is what I have:
I have a page that has several layers that I will either show/hide
based on a graphic/tab that the user clicks. (works perfectly)
On several of the layers there are forms that the user can update
information on. Well, after the user updates the information, I need
to 1.) refresh the data on the page(means a reload of the page), and
2.) take the user right back to were they started.
My problem is that when I refresh, the page goes back to the 1st layer
that is set as default to show.
So, here is what I did. I have two functions.
Function 1 is called when the user clicks on one of the tabs (Assets)
in this case. This will 1.) show the Assets tab and 2.) hide all the
rest of the tabs.
Well if I update that form for Assets, I need to 1.) refresh the data
and 2.) bring the user right back to Assets.
What I did for this (please tell me if there is a better way) was to
set a hidden field with the lastlocation of where the user clicked. In
this case the field value is now set to Assets.
So far everything is working great...
Well, if I submit the form because I've updating information, I need to
return back to the assets layer. To do this I set the location.url and
put a var in the url that I evaluate when I OnLoad the page. If the
value = Assets then I am able to show/hide the layers to get to the
Assets.
Again, this works great after much banging of my head against the
wall... Here come the problem.
Because I set the location.URL (I've also tried location.href) the
browser will automatically refresh. I do not want this. I want to set
the url and only refresh when I want to.
For example when I submit a form that updates data.
Help - How do you set the URL (using Javascript) and not have the page
refresh automatically? I've tried also trying to set the header, but I
can't with javascript.
I'm really stuck - Thank you in advance for your thoughts.
Terry