Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit form outside form

Status
Not open for further replies.

thompom

Technical User
Dec 4, 2006
395
GB
Hi - was sure this has been answered before and know the submit image should be inside the form - but cant find a solution:
Can anyone tell me why this submit image wont submit the form

Code:
<form name="fcuslistsrch" id="fcuslistsrch" action="cuslist.asp" onSubmit="return ew_ValidateForm2(this);" style="margin:0">

<!--This image submits fine-->
<input type="image" src="images/searchbut2.gif" onClick="this.form.submit();"/>

</form>

<!--this one doesnt-->
<input type="image" src="images/searchbut2.gif" onclick"document.fcuslistsrch.submit();"/>
 
Hi
[ul]
[li]Is invalid HTML. [tt]input[/tt] elements can be placed only inside [tt]form[/tt] elements.[/li]
[li]Is invalid HTML. Missing equal sign ( = ) between [tt]onclick[/tt] attribute's name and value.[/li]
[li]The first [tt]image[/tt] [tt]input[/tt]'s [tt]onclick[/tt] is pointless, its default behavior is to submit the [tt]form[/tt].[/li]
[li]The second [tt]image[/tt] [tt]input[/tt]'s [tt]onclick[/tt] should break its own default behavior and not submit.[/li]
[/ul]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top