Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

javascript error question?

Options
  • 23-01-2008 7:37pm
    #1
    Registered Users Posts: 648 ✭✭✭


    Hi


    im getting a js error on submitting a form
    the problem might be here

    if (!isNotSelected(form.reportdate-day, 'Date of Report (Day)',MUST_SELECT))
    return false;

    is it ok to have an input (and read from it via js) like reportdate-day ? (ie with the '-')

    tnx


Comments

  • Closed Accounts Posts: 1,200 ✭✭✭louie


    the "-" will be treated as minus (maths)
    same with other chars as well * / +


  • Closed Accounts Posts: 67 ✭✭BRENSH


    I am assuming that isNotSelected is your own function.

    If you give me the whole script assuming it is small I can help you.

    You cannot use the negitive sign as a variable idetifier. You should use underscore instead or even $

    Dont use any aritmetic operators as any part of an identifier


Advertisement