PDA

View Full Version : How 2 click a button from a link ?


Yovav
10-28-2002, 08:13 PM
I have a from on my ASP,

how can I submit it's button when I click on a link ?
(I want 2 use POST method)

this is what I try - (Not working):

<A href="Search_File_H.asp" target="new" onmouseclick="document.forms[0].submit()" onmouseover="window.status='<%=strLink%>';return true">

seems that what is on A href= goes first...

redhead
10-28-2002, 08:30 PM
right... does your form look like this?

<form name="FORM NAME" action="Search_File_H.asp" method="POST">
<!-- your form feilds here -->
</form>

you could use:

<a href="javascript:;" onclick="document.FORM NAME.submit();">Submit Form</a>

is that ok? :thumbsup:

beetle
10-28-2002, 10:34 PM
redhead's method is your best bet, but as a side note, I'd like to add that you can enact a 'click' on the submit button with something else...<form name="myform">
<input type="submit" name="Submit" value="Send" />
</form>

<a href="javascript:document.myform.Submit.click(); return false;">Submit Form</a>