0
function show_alert(){

var month = oMonthList.value;

var day = oDayField.value;

var gametype = oGameTypeList.value;

var gamenum = oGameNumberField.value;

var gamename = oGameNameField.value;

var modname = oModNameField.value;

var phase = oPhaseList.value;

var phasenum = oPhaseNumberField.value;

var pagenum = oNameNumberField.value;

var repname = oReplacementNameField.value;

var modlink = oModLinkField.value;

alert(phase);
}

Why does this not show the alert when the function is called, but removing all variables except the one in question (var phase) does? I'm guessing it's something to do with syntax, but I cannot pin down the issue.

4
  • Please include the code, where you are reading value from.. what are these list and fields? Commented Jan 3, 2012 at 7:43
  • 3
    One of your Fields or Lists is probably undefined. Enable your JavaScript debugger (Developer Tools or Firebug) and check for any errors. Commented Jan 3, 2012 at 7:46
  • It needs to be a requirement that you check your favorite javascript error console BEFORE you post a question here. There's a 99.99% chance that you have a javascript error with one of your variables that is stopping execution of the function and checking the error console or debug console will show you which one is causing the error. Commented Jan 3, 2012 at 8:01
  • Gluh, sorry guys: I rushed to ask this question before I took the time to really examine the relevant code. Shows what happens when you don't look before you leap, I guess. Commented Jan 3, 2012 at 8:09

1 Answer 1

1

Did you make sure that your javascript code doesn't throw any exception? If some object is undeclared or undefined, the code may be aborted early thus alert() is not not executed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.