Problem with a my Site

M

Markus

Hallo
I hope some one can help me with this code what i want it to do if the
IndexOf equals / then i want it to go to the function called Box but it does
not work why not.

Thank you
Markus

function redirect2(z){
var string1=temp1[z].value
if (string1.indexOf("/")==-1)
{
Box()
}
else {
window.location=temp1[z].value
return false
}
}

function box(){
if(document.FrontPage_Form1.CDS_ID.value == "")
alert("Test")
return false
}
}
 
R

Ronx

Making rash assumptions:

1) IndexOf equals / means the string being tested includes "/"
somewhere in it.

2) The array or object temp1 has been defined elsewhere in the script as
a global variable (if it has not been defined then it must be), and that
the value of the parameter z has been checked for being within the scope
of temp1.


function redirect2(z){
var string1=temp1[z].value;
if (string1.indexOf("/")>-1) {
return Box();
}
else {
window.location=temp1[z].value;
return false;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top