Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help.... Last effort...

Status
Not open for further replies.

carlosAlberto

IS-IT--Management
Oct 9, 2001
109
GB
Hi Everybody,

I have posted a few messages on this site and the help has been fabulous, I'm near the end of my project and have 1 last final problem. I hope some of you guys may be able to help!!!! :)

It's based around using .js files. I tried to set up a system using user profiles defining their own <select> list. The contents of this <select> list is saved when submitted using a cgi script.

The problem is, once the list has been saved. When i display this again it shows the old list until i press 'refresh'.

Is there a way around of pressing refresh all the time?????

(may a way to refresh automatically) I'm not sure, I've tried a couple of things but have ran out of ideas.

Please help........ I promise not to bother the forum ever again with my trivial problem................. ;)
 
Im not sure what you are trying to do.
But ill suggest you depdnding on where you are comming from on to this window you have to automatically refresh the window using js. Another way is if you are allready there try again to refresh using some how javascript to do this.

The problem is that i dont understand excactly what u r trying to do?

e.g if you use a popup page to save your Select options
then you should try something like this.

<a href=javascript:eek:pener.location.reload();window.close()<img src=/images/butclose.gif></a>



this will automatically close the popup window and also will refresh the page underneath.

you can also loose the button if you want this to happen automatically or target the right objects depending what your trying to do.

I hope i made things easier than worst

Regards
 
Hi thanks for the reply, I'll try to make things a bit easier to understand.

It's all using the same browser window.

This profile is setup (copying from one list to another in the previous screen *same window*) in one .html page then dislayed in a new .html page. (this html page is called from the script after it has saved the jsfile).

Code from cgi script (TCL):
it puts html output to the screen (actually javascript) that calls a window.location to change html page. (as described above)

This html page has a <body onload> function which populates a list (which was the one just created and saved). The problem is this needs refreshing before it displays the new one. Hope this helps!! :)

 
Ok, if I understand you right, all you need to do is make use of the selected parameter of the drop-down box.

ex:
<select name=profileSelector>
<option name=opt1>option 1
<option name=opt2 selected>option 2
<option name=opt3>option 3
</select>

the js version of that is this:

say you wanted to select the third from the top item in the list box:

document.profileSelector.selectedIndex=2;

hope that helps







Robert Carpenter
questions? comments? thanks? email me!
linkemapx@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
I have a select box with multiple option. I want the selected item to be highlighted when i visit back to that page. In IE it works fine, even if the item is way down in the list. But in Netscape the the focus is not scrolled down to show the selected item. User would have to scroll down to see the selected item. Is it possible to solve this problem ?

Any help in this regard would be appreciated greatly.
 
Hi eclipse,

Thanks for the response.

I don't think you've understood what i mean. I am displaying the select list from the jsfile. I have an onload function which loads up the appropriate select list (parameter from previous page).

The problem is the jsfile file is changed through a cgi script. When i try to show the list again it show the list before it was edited and changed (stored in chache)

I would like to automate this process rather than manually pressing 'refresh'.

Thanks,
 
stick this in the last line:

location.refresh(); Robert Carpenter
questions? comments? thanks? email me!
linkemapx@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Hi Eclipse,

I tried this, I got a javascript error stating location.refresh() is not a function.

(I'm using ie 5)
 
well, that is bad.

try this:

location='page.html';//where page.html would be the page needing to be refreshed.

if you have frames, you could use a navigation-type frameset to do the same thing above, that refreshes the page (I know from expirence;-))

Robert Carpenter
questions? comments? thanks? email me!
linkemapx@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
theEclipse,
I think you meant [tt]location.reload()[/tt] instead of [tt]location.refresh()[/tt]. From the excellent 'Dynamic HTML' book by Danny Goodman:

[tt]reload( [unconditional] )[/tt]

Performs a hard reload of the document associated with the location object. By default the reload method performs a conditional-GET action, which retrieves the file from the browser cache if the file is still in the cache (and cache is turned on). To force a reload from the server, force an unconditional-GET by adding the [tt]true[/tt] Boolean parameter.

Cheers, Neil
 
Hi,

To refresh the page i have tried:

- Creating a function that refreshes the page when loaded
- Using the onLoad function to refresh

The problem is - they are in an endless loop of refreshing. Once it loads see's the reload then reloads again doing this constantly.

Is there any way this will be reloaded once.

Thanks,
 
<script>
function reload()
{
if(window.location.search.indexOf(&quot;reloaded&quot;)<0)
{
window.location=window.location+&quot;?reloaded&quot;
}
}

</script>

</head>

<body onload=&quot;reload()&quot;> jared@eae.net -
 
This doesn't seem to work.


I added a semi-colon to the window.location line. It gives me an error of Expected ':'
 
It works fine for me. Copy/paste my code into a new document and see if it works. If it does, there must be something else wrong with the page you implemented it on... jared@eae.net -
 
I cut and pasted it and it didn't work.

What browser are you using???

I'm using ie 5
 
I think the problem i am getting, is because i am already passing the page a variable from the previous page, then passing reloaded after that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top