Alan Klein
09-16-2003, 02:05 PM
Hello,
I'm trying to grab some information that the user enters on my HTML page and then call a "goToUrl()" function. It works when I get the data from a "prompt()", but not when I get it from an entry field on the page. The "MM_goToURL" in the following code is a function that DreamWeaver has that pops up a new window with the given .htm file.
Here's my code....
THIS ONE WORKS.....
function promptForFid() {
var returnValue;
returnValue = prompt('Enter the name of the FID to be scripted...','');
if (returnValue != null) {
if (returnValue.toUpperCase() == 'RCU' || 'MAP' || 'EBD') {
MM_goToURL('parent','Fid_' + returnValue + '.htm')
} //end if
} // end if
} // end fuction
THIS ONE DOESN'T....I'm calling this from an onClick event of a button. I know the "fid" is getting passed correctly because I had an alert() in there to see it. The new page just never opens.
function newFunction(fid) {
if (fid.toUpperCase() == 'RCU' || 'NRC' || 'EBD') {
MM_goToURL('parent','Fid_' + fid + '.htm')
} //end if
}
If anyone can see any reason why the newFunction() isn't working I would greatly appreciate it. I'm pretty new to this, and this looks like it should work. I don't know what else to try to get it to work. Thanks!!
I'm trying to grab some information that the user enters on my HTML page and then call a "goToUrl()" function. It works when I get the data from a "prompt()", but not when I get it from an entry field on the page. The "MM_goToURL" in the following code is a function that DreamWeaver has that pops up a new window with the given .htm file.
Here's my code....
THIS ONE WORKS.....
function promptForFid() {
var returnValue;
returnValue = prompt('Enter the name of the FID to be scripted...','');
if (returnValue != null) {
if (returnValue.toUpperCase() == 'RCU' || 'MAP' || 'EBD') {
MM_goToURL('parent','Fid_' + returnValue + '.htm')
} //end if
} // end if
} // end fuction
THIS ONE DOESN'T....I'm calling this from an onClick event of a button. I know the "fid" is getting passed correctly because I had an alert() in there to see it. The new page just never opens.
function newFunction(fid) {
if (fid.toUpperCase() == 'RCU' || 'NRC' || 'EBD') {
MM_goToURL('parent','Fid_' + fid + '.htm')
} //end if
}
If anyone can see any reason why the newFunction() isn't working I would greatly appreciate it. I'm pretty new to this, and this looks like it should work. I don't know what else to try to get it to work. Thanks!!