0

I'm trying to pass variables into a Javascript function and running into a problem that I don't understand.

This is fine.

<select name="AppointmentTimeDropDownList" id="username" onchange="checkUserName(this.value, document.forms['CustomerInteractionForm'].elements['AppointmentDateTextBox'].value)">

But this give me a syntax error my IDE says its missing ; before statement.

<select name="AppointmentTimeDropDownList" id="username" onchange="checkUserName(this.value, document.forms['CustomerInteractionForm'].elements['AppointmentDateTextBox'].value), document.forms['CustomerInteractionForm'].elements['AppointmentAssignedToDropDownList'].value)">
1
  • You have an additional ) at .elements['AppointDateTextBox'].value), that is likely there from your original statement. Commented Aug 22, 2012 at 18:04

1 Answer 1

5

It appears you have an errant ) here:

... .elements['AppointmentDateTextBox'].value), d ...
Sign up to request clarification or add additional context in comments.

2 Comments

Derp, sometimes someone else just needs to look at your code, thanks!
Not to start an editor war, but if you're not already, using a text editor that highlights matching brackets, braces, and parenthesis, these sort of mistakes can become more obvious.

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.