|
|
Small problem could anyone help?
Hi,
Im still sort of new to spring and at the moment im basically trying to include a small form with a link as my submit in a jsp, for example
lt;codegt;
lt;form name=quot;testquot; action=quot;lt;%=request.getContextPath() %gt;/resource.htmquot; method=quot;postquot;gt; lt;input type=quot;hiddenquot; name=quot;dquot; value=quot;aViewUserquot; /gt; lt;input type=quot;hiddenquot; name=quot;userquot; value=quot;lt;c ut value=quot;${user.userID}quot;/gt;quot; /gt; lt;td width=quot;52quot; class=quot;style2quot;gt;lt;a hrcf=quot;javascript:submit();quot;gt;Viewlt;/agt;lt;/tdgt; lt;/formgt;
lt;/codegt;
basically im trying to create a link such as /resource.htm?d=aViewUseramp;user=lt;whatevernamegt; from submitting this form and this way the link is actually hidden. However when ever i press the View link which is a javascript:submit(); nothing happens at all. Im wondering if im doing anything wrong spring side? because im very confused
Thanks heaps in advanced
hi
how about document.lt;form idgt;.submit()?
and may i ask why use link to submit? how about a submit button ?
richard
I use a link to submit because at the moment im bringing back data in the form of a list of results (users of a system) and on the left of that are links to View, Edit and Delete, the only problem is with the way the system is designed i gotta pass the user's id as a part of the URI and i dont want that viewed. However the business side doesnt want buttons they want links
its really complicated and stupid and normally i would agree with you but in this case i have to make it a link
document.test.submit(); does not work am i meant to still have javascript: infront of that? because if i put javascript: infront it still doesnt work, the page just remains as is.
try adding id=quot;testquot; in the lt;form gt; element.
Hey Ric
unfortunately no go with this either, the error im getting is
'document.test' is null or not an object
when i leave it as lt;a hrcf=quot;document.test.submit();quot;gt; it says document.test.submit()/ cannot be found so i normally leave javascript: infront of it
try hrcf=quot;#quot; onclick=quot;document.getElementById('test').submit()quot;
richardOriginally Posted by amokz0rHey Ric
unfortunately no go with this either, the error im getting is
'document.test' is null or not an object
when i leave it as lt;a hrcf=quot;document.test.submit();quot;gt; it says document.test.submit()/ cannot be found so i normally leave javascript: infront of it Ric,
Thanks champ that worked a charm |
|