Click to See Complete Forum and Search --> : activating a submit button from another button


pelegk1
01-07-2004, 05:28 AM
how can i activate a submit button by pressing another button that will active the submit button itself?
thanks inadvance
epelg

fredmv
01-07-2004, 05:29 AM
You can emulate a submit button doing something like this:<input type="button" value="Submit" onclick="docment.forms[0].submit();" />

clairec666
01-07-2004, 05:30 AM
You can use anything as a 'submit' button......... a hyperlink, image, whatever you want.

If you wanted a button, eg. saying 'send form' instead of submit,

<form name="">
<input type="button" value="send form" onclick="form.submit">
</form>

fredmv
01-07-2004, 05:40 AM
Originally posted by clairec666
saying 'send form' instead of submitWhen using a genuine submit button, you can simply change what it says using it's value attribute.Originally posted by clairec666
<form name="">The name attribute is deprecated for the <form> element under all XHTML DOCTYPEs. It's usually safer to access forms using array notation through the DOM.Originally posted by clairec666
<input type="button" value="send form" onclick="form.submit">That syntax is incorrect. If inside the form, you could simply do:<input type="button" value="Submit" onclick="submit();" />Else, if not inside of the form, you could use the method I previously described. Also, just to note, you should be closing all tags if using an XHTML DOCTYPE.

pelegk1
01-12-2004, 07:08 AM
10X:)
in my name and in the the name of the rebbay yariv moshe malka