submit() error

X

Xerxes

Hi,
I am trying to submit a form when a non-submit button is clicked!
I have:
<input name="add_dev" type="button" value="Add Device" onClick="
this.form.action='<?php echo $_SERVER['PHP_SELF']?>';
this.form.submit();">

When I run it, it says:
this.form.submit is not a function.

(I tired document.form_name.submit(), same thing).

I already have a "submit" button that submits the form to the file
specified in "Action".

Thanks for your help.
 
P

Paul Lautman

Xerxes said:
Hi,
I am trying to submit a form when a non-submit button is clicked!
I have:
<input name="add_dev" type="button" value="Add Device" onClick="
this.form.action='<?php echo $_SERVER['PHP_SELF']?>';
this.form.submit();">

When I run it, it says:
this.form.submit is not a function.

(I tired document.form_name.submit(), same thing).

I already have a "submit" button that submits the form to the file
specified in "Action".

Thanks for your help.

Why not just have 2 submit buttons?
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top