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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I really need your help. JS works locally but not remotely!!!

Status
Not open for further replies.

ujohnc00

Programmer
Jun 2, 2004
13
0
0
US
hello,
I am building a hefty intranet application. My current situation is leaving me utterly confused. I have three pulldown menus: action_select, station_select, and option_select. What the below function does is simply add URL parameters to a webpage name, and then redirect the current page to the built location string. This works accordingly on my developement computer, but nothing happens at all on a different computer. The only difference is that I am using IE5.5 on my dev computer, and IE5 on the other computer. I am so frustrated because I just cannot find the answer as to why the below code works on one computer and not on another. It even works in NN6.2. Please help. Thanks in advance for your feedback.

function appendStationIDtoURL() {
var action = MM_findObj("action_select");
var station = MM_findObj("station_select");
var choice = MM_findObj("option_select");

// do nothing if the selected choice is the first in the list
if (((action.options[action.selectedIndex].text == "Create New Record") &&
(choice.options[choice.selectedIndex].text != "Invoice Tracking") &&
(station.selectedIndex == 0)) ||
(choice.selectedIndex == 0 || action.selectedIndex == 0))
return false;

var station_id = station.options[station.selectedIndex].value; // get the actual station_id value
var s_name = (station.selectedIndex == 0) ? "" : station.options[station.selectedIndex].text;

var page;
var action;
switch (choice.selectedIndex) {
case 1:
page = "1358.cfm";
break;
case 2:
page = "travel.cfm";
break;
case 3:
page = "tuition.cfm";
break;
case 4:
page = "patient_fund.cfm";
break;
case 5:
page = "journal_logbook.cfm";
break;
case 6:
page = "journal_voucher.cfm";
break;
case 7:
page = "expenditure_logbook.cfm";
break;
case 8:
page = "expenditure_voucher.cfm";
break;
case 10:
page = "invoice_tracking.cfm";
break;
default:
return false;
break;
}
switch (action.selectedIndex) {
case 1:
action = "create";
break;
case 2:
action = "edit";
break;
case 3:
action = "view"; break;
default:
return false;
break;
}


self.location.href = page +'?station_id=' + station_id + '&station_name=' + s_name + '&action=' + action; //redirect this page

return true; // everything was successful
}
 
sounds really weird. I can't see anything here.

try removing self :

location.href = page +'?station_id=' + station_id + '&station_name=' + s_name + '&action=' + action; Gary Haran
 
xutopia
thanks for your reply but unfortunately that didn't do it.
do you think that it is because IE5 handles some of this js different from IE5.5?
thanks
 
here is something even stranger: I have hardcoded the following to be the only line in the function, and still it does nothing?!?
weird...
is there a security setting that might affect this?
thanks
 
sorry, the function now looks like:

function appendStationIDtoURL() {
location.href = "1358.cfm?action=view&method=search";
}

still, this does not work.
any ideas?
 
it unfortunately does not help to use a fully qualified URL.
thanks for the suggestions :)
 
READ THE MICROSOFT BUG REPORT !!!

xutopia wants to help - really - just listen to the master [yoda] <- xutopia

me -> Einstein47
(Love is like PI - natural, irrational, endless, and very important.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top