Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

javascript error question?

  • 23-01-2008 07:37PM
    #1
    Registered Users, Registered Users 2 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