"Not enough arguments" but void

Discussion in 'Javascript' started by roN, Jul 27, 2007.

  1. roN

    roN Guest

    Hi,

    I get a weird error in Firefox, it tells me: "Not enough arguments" but the
    function doesn't require any arguments.
    The function looks like:
    function add(void)
    {
    score+=parseInt(document.getElementById('new_business').value);
    score+=parseInt(document.getElementById('starting').value);
    score+=parseInt(document.getElementById('liquid').value);
    score+=parseInt(document.getElementById('funds').value);
    score+=parseInt(document.getElementById('home').value);
    score+=parseInt(document.getElementById('income').value);
    score+=parseInt(document.getElementById('excited').value);
    alert(score);

    document.getElementById('postscore').value=score;
    document.getElementById('cusscore').innerHTML=score;
    var curdate = new Date();
    var hour = curdate.getHours();
    hour=hour-3; // convert hour from EST to PST
    if (score >=70 && hour>=8 && hour<=16) // only between 8am and 5pm PST
    {
    dosomething();
    }
    else
    {
    dosomethingelse();
    }
    }

    and i call it with calls like:
    <select name="new_business" id="new_business" onchange="add()">

    The whole page would be at: http://www.dvdnowkiosks.com/callcenter3.php
    It's a form for a call centre and different answers give different points
    which then will be displayed on the bottom in the field "cusscore".

    Any help would be appreciated!

    Thanks lots!

    Ron
     
    roN, Jul 27, 2007
    #1
    1. Advertising

  2. roN

    David Mark Guest

    On Jul 27, 5:20 pm, "roN" <> wrote:
    > Hi,
    >
    > I get a weird error in Firefox, it tells me: "Not enough arguments" but the
    > function doesn't require any arguments.
    > The function looks like:
    > function add(void)


    function add()
     
    David Mark, Jul 27, 2007
    #2
    1. Advertising

  3. roN

    roN Guest

    "David Mark" <> wrote in message
    news:...
    > On Jul 27, 5:20 pm, "roN" <> wrote:
    >> Hi,
    >>
    >> I get a weird error in Firefox, it tells me: "Not enough arguments" but
    >> the
    >> function doesn't require any arguments.
    >> The function looks like:
    >> function add(void)

    >
    > function add()


    I had done that already earlier...then added void... returns the same error
    either way...
     
    roN, Jul 27, 2007
    #3
  4. roN

    David Mark Guest

    On Jul 27, 5:52 pm, "roN" <> wrote:
    > "David Mark" <> wrote in message
    >
    > news:...
    >
    > > On Jul 27, 5:20 pm, "roN" <> wrote:
    > >> Hi,

    >
    > >> I get a weird error in Firefox, it tells me: "Not enough arguments" but
    > >> the
    > >> function doesn't require any arguments.
    > >> The function looks like:
    > >> function add(void)

    >
    > > function add()

    >
    > I had done that already earlier...then added void... returns the same error
    > either way...


    Take "void" back out and change the name of the function. Apparently
    you can't use "add." I changed it to "add2" and it worked fine.
     
    David Mark, Jul 27, 2007
    #4
  5. roN

    roN Guest

    "David Mark" <> wrote in message
    news:...
    > On Jul 27, 5:52 pm, "roN" <> wrote:
    >> "David Mark" <> wrote in message
    >>
    >> news:...
    >>
    >> > On Jul 27, 5:20 pm, "roN" <> wrote:
    >> >> Hi,

    >>
    >> >> I get a weird error in Firefox, it tells me: "Not enough arguments"
    >> >> but
    >> >> the
    >> >> function doesn't require any arguments.
    >> >> The function looks like:
    >> >> function add(void)

    >>
    >> > function add()

    >>
    >> I had done that already earlier...then added void... returns the same
    >> error
    >> either way...

    >
    > Take "void" back out and change the name of the function. Apparently
    > you can't use "add." I changed it to "add2" and it worked fine.


    Good suggestion! But it didn't help much :(, i changed the name to
    addscore() but it still gives the same error. Please see the new version on
    http://www.dvdnowkiosks.com/callcenter3.php.

    Thank you!
    Ron
     
    roN, Jul 27, 2007
    #5
  6. roN

    David Mark Guest

    On Jul 27, 6:34 pm, "roN" <> wrote:
    > "David Mark" <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    > > On Jul 27, 5:52 pm, "roN" <> wrote:
    > >> "David Mark" <> wrote in message

    >
    > >>news:...

    >
    > >> > On Jul 27, 5:20 pm, "roN" <> wrote:
    > >> >> Hi,

    >
    > >> >> I get a weird error in Firefox, it tells me: "Not enough arguments"
    > >> >> but
    > >> >> the
    > >> >> function doesn't require any arguments.
    > >> >> The function looks like:
    > >> >> function add(void)

    >
    > >> > function add()

    >
    > >> I had done that already earlier...then added void... returns the same
    > >> error
    > >> either way...

    >
    > > Take "void" back out and change the name of the function. Apparently
    > > you can't use "add." I changed it to "add2" and it worked fine.

    >
    > Good suggestion! But it didn't help much :(, i changed the name to


    Sure it did.

    > addscore() but it still gives the same error. Please see the new version onhttp://www.dvdnowkiosks.com/callcenter3.php.


    Gives me a different error. And one that indicates it made it into
    the addScore function. Add this to the top of that function:

    var score;

    Are you reading the error console?
     
    David Mark, Jul 27, 2007
    #6
  7. roN

    roN Guest

    "David Mark" <> wrote in message
    news:...
    > On Jul 27, 6:34 pm, "roN" <> wrote:
    >> "David Mark" <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >>
    >>
    >> > On Jul 27, 5:52 pm, "roN" <> wrote:
    >> >> "David Mark" <> wrote in message

    >>
    >> >>news:...

    >>
    >> >> > On Jul 27, 5:20 pm, "roN" <> wrote:
    >> >> >> Hi,

    >>
    >> >> >> I get a weird error in Firefox, it tells me: "Not enough arguments"
    >> >> >> but
    >> >> >> the
    >> >> >> function doesn't require any arguments.
    >> >> >> The function looks like:
    >> >> >> function add(void)

    >>
    >> >> > function add()

    >>
    >> >> I had done that already earlier...then added void... returns the same
    >> >> error
    >> >> either way...

    >>
    >> > Take "void" back out and change the name of the function. Apparently
    >> > you can't use "add." I changed it to "add2" and it worked fine.

    >>
    >> Good suggestion! But it didn't help much :(, i changed the name to

    >
    > Sure it did.
    >
    >> addscore() but it still gives the same error. Please see the new version
    >> onhttp://www.dvdnowkiosks.com/callcenter3.php.

    >
    > Gives me a different error. And one that indicates it made it into
    > the addScore function. Add this to the top of that function:
    >
    > var score;
    >
    > Are you reading the error console?

    YeSSSSSSSSSSSSSS, I have read it but my firefox apparently didn't refresh
    properly the first time. Thanks 10,000 times! YEAH! Great!!! :) Thanks and
    have a good weekend :)
     
    roN, Jul 27, 2007
    #7
  8. roN

    David Mark Guest

    On Jul 27, 6:51 pm, "roN" <> wrote:
    > "David Mark" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On Jul 27, 6:34 pm, "roN" <> wrote:
    > >> "David Mark" <> wrote in message

    >
    > >>news:...

    >
    > >> > On Jul 27, 5:52 pm, "roN" <> wrote:
    > >> >> "David Mark" <> wrote in message

    >
    > >> >>news:...

    >
    > >> >> > On Jul 27, 5:20 pm, "roN" <> wrote:
    > >> >> >> Hi,

    >
    > >> >> >> I get a weird error in Firefox, it tells me: "Not enough arguments"
    > >> >> >> but
    > >> >> >> the
    > >> >> >> function doesn't require any arguments.
    > >> >> >> The function looks like:
    > >> >> >> function add(void)

    >
    > >> >> > function add()

    >
    > >> >> I had done that already earlier...then added void... returns the same
    > >> >> error
    > >> >> either way...

    >
    > >> > Take "void" back out and change the name of the function. Apparently
    > >> > you can't use "add." I changed it to "add2" and it worked fine.

    >
    > >> Good suggestion! But it didn't help much :(, i changed the name to

    >
    > > Sure it did.

    >
    > >> addscore() but it still gives the same error. Please see the new version
    > >> onhttp://www.dvdnowkiosks.com/callcenter3.php.

    >
    > > Gives me a different error. And one that indicates it made it into
    > > the addScore function. Add this to the top of that function:

    >
    > > var score;

    >
    > > Are you reading the error console?

    >
    > YeSSSSSSSSSSSSSS, I have read it but my firefox apparently didn't refresh
    > properly the first time. Thanks 10,000 times! YEAH! Great!!! :)


    You should always clear the error console before trying a fix.
    Otherwise it is confusing as to which errors are current and which
    were from a previous version.
     
    David Mark, Jul 28, 2007
    #8
  9. roN

    Guest

    On Jul 27, 2:20 pm, "roN" <> wrote:
    > Hi,
    >
    > I get a weird error in Firefox, it tells me: "Not enough arguments" but the
    > function doesn't require any arguments.
    > The function looks like:
    > function add(void)
    > {

    void operator requires an expression after that. You can't set "void"
    to be a parameter variable.

    function add() {
    var score = 0;
    ....
    }


    > score+=parseInt(document.getElementById('new_business').value);
    > score+=parseInt(document.getElementById('starting').value);
    > score+=parseInt(document.getElementById('liquid').value);
    > score+=parseInt(document.getElementById('funds').value);
    > score+=parseInt(document.getElementById('home').value);
    > score+=parseInt(document.getElementById('income').value);
    > score+=parseInt(document.getElementById('excited').value);
    > alert(score);
    >
    > document.getElementById('postscore').value=score;
    > document.getElementById('cusscore').innerHTML=score;
    > var curdate = new Date();
    > var hour = curdate.getHours();
    > hour=hour-3; // convert hour from EST to PST
    > if (score >=70 && hour>=8 && hour<=16) // only between 8am and 5pm PST
    > {
    > dosomething();
    > }
    > else
    > {
    > dosomethingelse();
    > }
    >
    > }
    >
    > and i call it with calls like:
    > <select name="new_business" id="new_business" onchange="add()">
    >
    > The whole page would be at:http://www.dvdnowkiosks.com/callcenter3.php
    > It's a form for a call centre and different answers give different points
    > which then will be displayed on the bottom in the field "cusscore".
    >
    > Any help would be appreciated!
    >
    > Thanks lots!
    >
    > Ron
     
    , Jul 30, 2007
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ollej Reemt
    Replies:
    7
    Views:
    538
    Jack Klein
    Apr 22, 2005
  2. Stig Brautaset

    `void **' revisited: void *pop(void **root)

    Stig Brautaset, Oct 25, 2003, in forum: C Programming
    Replies:
    15
    Views:
    791
    The Real OS/2 Guy
    Oct 28, 2003
  3. Kevin Walzer

    Not enough arguments for format string

    Kevin Walzer, Nov 14, 2005, in forum: Python
    Replies:
    2
    Views:
    11,036
    James
    Nov 14, 2005
  4. Replies:
    5
    Views:
    841
    S.Tobias
    Jul 22, 2005
  5. Replies:
    1
    Views:
    412
    Victor Bazarov
    May 23, 2007
Loading...

Share This Page