"Not enough arguments" but void

R

roN

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
 
D

David Mark

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()
 
D

David Mark

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.
 
R

roN

David Mark said:
Sure it did.


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 :)
 
D

David Mark

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.
 
D

dhtmlkitchen

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;
....
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top