In article <ba**************************@posting.google.com >,
jr********@hotmail.com enlightened us with...
Can we click a link and it will submit the form to the other page?
Usually we will submit the
form to other page by clicking a submit button.
Now I need to do the following, but what if I have many data in the
form? Any workarounds?
<a href="http://myserver/index.jsp?name=test&actionType=test"
target="_blank">Add New Document</a>
Please advise. thanks!!
Yes, but note that it can die in non-supporting browsers. I don't recommend
it for the 'net.
Intranet is fine.
This is what I do.
-- actual code from generated page, modified for sensitive content --
<td>
<form name='otFrm11' action='admnType.jsp' method='get'>
<input type='hidden' name='Type' value='WIRELESS'><input type='hidden'
name='description' value='Wireless'><input type='hidden' name='status'
value='1'></form>
<a href="javascript
:document.forms['otFrm11'].submit();">WIRELESS</a></td>
-- end code --
Note that I am using the javascript protocol for a link. This is not
recommended for general use and is not very cross-browser. This works in IE6
and NN7, the only browsers I need to care about. If you need it more cross-
browser, remove the script from the href and put it in onClick and put a real
location in the href.
<a href="someNonJsPage.html" onClick="document.forms['formname'].submit()">
If the submit (target of the form or a function that opens a new window and
sets target) is to a different window, add "return false" to the onClick so
the href isn't followed in the main page.
<a href="someNonJsPage.html" onClick="document.forms['formname'].submit();
return false;">
HTH
--
--
~kaeli~
He's your God, they're your rules - you burn in Hell.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace