Why isn't invoking "click" doing what I want?

L

laredotornado

Hi,

I'm on PC Firefox. I have this button

<input id="configForm:apply" name="configForm:apply" type="submit"
value="Apply" onclick="return saveGridData();;if(typeof
window.clearFormHiddenParams_configForm!='undefined')
{clearFormHiddenParams_configForm('configForm');}" class="npsButton" /
and in a separate function I have

documenet.getElementById("configForm:apply").click;

but although I've confirmed the onclick action of the button is
getting called, the form is not submitting and my browser is not going
to the next page. What I'm trying to do is simulate a user clicking
this submit button. Any ideas what else I can do to make this happen?

Thanks, - Dave
 
E

Erwin Moller

laredotornado schreef:
Hi,

I'm on PC Firefox. I have this button

<input id="configForm:apply" name="configForm:apply" type="submit"
value="Apply" onclick="return saveGridData();;if(typeof
window.clearFormHiddenParams_configForm!='undefined')
{clearFormHiddenParams_configForm('configForm');}" class="npsButton" /

Looking at the onClick:
1) You return something
2) You start an if() etc.

How do you expect the 'if' is reached if you return first?

Another thing: I am not 100% sure, but an id with a : in the name might
very well be illegal.

Regards,
Erwin Moller
and in a separate function I have

documenet.getElementById("configForm:apply").click;

but although I've confirmed the onclick action of the button is
getting called, the form is not submitting and my browser is not going
to the next page. What I'm trying to do is simulate a user clicking
this submit button. Any ideas what else I can do to make this happen?

Thanks, - Dave


--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top