Hello ,
    Thank you Wendy, Hubert and Ram  for your reply. I followed what you
have suggested and solved my problem.

Wendy ,  attSubmit() function accepting argument is cut paste error , I
am sorry I confused you. Thank you for the code snippet. 
Hubert, you are right "the problem is that the link itself goes
somewhere 
 instead of just calling the JS function."

Now on my JSP
<%String attID="1";%>
<a href="noscript.html" 
 onclick="attSubmit('<%=attID%>');return false;">Name</a>

<SCRIPT language="javascript">
function attSubmit(ID)
{
        document.forms[0].attachmentID.value=ID;
        document.forms[0].action="/WFIGUI/attachment.do";
        document.forms[0].submit();
}
</SCRIPT>

I have one question though. I do not have noscript.html in my webapp. Do
I have to create one.

Thank you,
Sandhya
-----Original Message-----
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 11, 2004 1:21 PM
To: Struts Users Mailing List
Subject: RE: How to convert <A href> tag to a submit button


So it's the 'return false' statement that makes your links different
from
Sandhya's.

--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> > I think your problem is that the link itself goes somewhere 
> > instead of just
> > calling the JS function.  Why don't you try something like
> > <html:link href="javascript:attSubmit()">attName</html:link>
> > or even just a regular, non-struts tag, link?
> 
> I think the "javascript:function()" syntax is frowned upon by
JavaScript
> purists...
> 
> My links turn out looking like this:
> <a href="noscript.html" title="Manual Lookup"
> onclick="advancedTab();return false;">Manual Lookup</a>
> 
> Where 'noscript.html' is a page that people never see.  Well, unless
> they hava JavaScript turned off, in which case they never would have
> gotten this far in my webapp.
> 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to