Re: Submiting a form through a link

2003-06-30 Thread Firat TIRYAKI
Well, filling the href parameter to tell that it should read javascript, you
can use the below alternative.

a href=javascript:// onclick=document.forms[0].submit();

F.


- Original Message -
From: Kruse, Matt [EMAIL PROTECTED]
To: 'Struts Users Mailing List ' [EMAIL PROTECTED]
Sent: Sunday, June 29, 2003 6:31 PM
Subject: RE: Submiting a form through a link


 a href= onclick=document.forms[0].submit();return false;Click
 here/a
 The above code works for me. Not sure if the return false; has
 any impact - probably does nothing.

 The return false is definitely important. It tells the browser that, after
 running the commands in the onClick handler, it should NOT go to the href.
 If you return true (default) then the browser will go to the href after
 running the commands.

 In this case, if you aren't returning false, then the form will submit and
 the browser will immediately abandon that request and instead try to go to
 the href URL, making it look like nothing happened.

 Matt




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



RE: Submiting a form through a link

2003-06-29 Thread Kruse, Matt
a href= onclick=document.forms[0].submit();return false;Click
here/a
The above code works for me. Not sure if the return false; has 
any impact - probably does nothing.

The return false is definitely important. It tells the browser that, after
running the commands in the onClick handler, it should NOT go to the href.
If you return true (default) then the browser will go to the href after
running the commands.

In this case, if you aren't returning false, then the form will submit and
the browser will immediately abandon that request and instead try to go to
the href URL, making it look like nothing happened.

Matt


RE: Submiting a form through a link

2003-06-29 Thread Steve Raeburn
Thanks for the clarification. I knew a normal link worked like that but
wasn't sure of the interaction with the form submission.

Steve

 -Original Message-
 From: Kruse, Matt [mailto:[EMAIL PROTECTED]
 Sent: June 29, 2003 8:31 AM
 To: 'Struts Users Mailing List '
 Subject: RE: Submiting a form through a link


 a href= onclick=document.forms[0].submit();return false;Click
 here/a
 The above code works for me. Not sure if the return false; has
 any impact - probably does nothing.

 The return false is definitely important. It tells the browser that, after
 running the commands in the onClick handler, it should NOT go to the href.
 If you return true (default) then the browser will go to the href after
 running the commands.

 In this case, if you aren't returning false, then the form will submit and
 the browser will immediately abandon that request and instead try to go to
 the href URL, making it look like nothing happened.

 Matt




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



Re: Submiting a form through a link

2003-06-29 Thread Cristiano Moreira Silva
First of all, thanks for helping me, but I've one
doubt: in the example
below (the one you sent me), you aren't using
html:link but html:hidden
instead.  Where I put my link reference? Thanks again.

 html:form action=/path
 html:hidden property=action value=MyAction/
 /html:form

- Original Message -
From: Steve Raeburn [EMAIL PROTECTED]
To: Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 6:17 PM
Subject: RE: Submiting a form through a link


   a href=
onclick=document.forms[0].submit();return
false;Click
 here/a
   (or the equivalent using Struts html:link tag.)

   html:form action=/path
 html:hidden property=action
value=MyAction/
   /html:form

 The above code works for me. Not sure if the return
false; has any
impact -
 probably does nothing.
 Do you have more than one form on the page? You
might need to change the
 forms[] index number.
 You can also try using the form name (which is the
same as defined in
 struts-config.xml) e.g.

   document.forms['testForm'].submit()

 If that doesn't work then please post more of your
form  link code.

 Steve

 p.s. Don't forget that if your users don't have
javascript enabled then
they
 won't be able to use this feature of your site. ;-)

  -Original Message-
  From: Cristiano Moreira Silva
[mailto:[EMAIL PROTECTED]
  Sent: June 28, 2003 12:02 PM
  To: Struts Users Mailing List
  Subject: Submiting a form through a link
 
 
  Hello. I'm trying to submit a html:form through a
  html:link. When I click the link, on the onclick
  event, I call a javascript function and execute:
 
  document.forms[0].submit()
 
  Then nothing happens.
 
  Can someone send me a simple example (or a URL to
it)
  of submiting a html:form through html:link?
Thanks.
 
 
 
  =
 

  Cristiano Moreira Silva
  Site - http://computologo.vila.bol.com.br
  E-mail - [EMAIL PROTECTED]
  Tudo posso nAquele que me fortalece. Fp. 4:13
 
 
___
  Yahoo! Mail
  Mais espaço, mais segurança e gratuito: caixa
postal de 6MB,
  antivírus, proteção contra spam.
  http://br.mail.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]




=

Cristiano Moreira Silva
Site - http://computologo.vila.bol.com.br
E-mail - [EMAIL PROTECTED]
Tudo posso nAquele que me fortalece. Fp. 4:13

___
Yahoo! Mail
Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção 
contra spam.
http://br.mail.yahoo.com/

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



RE: Submiting a form through a link

2003-06-29 Thread Steve Raeburn
You don't need to use html:link because the link doesn't actually link to
anything, it just triggers the form submission. The path to your action is
actually in the html:form tag. The parameters that would normally be added
to the URL are specified in the hidden fields.

If that's still not clear it would help if you posted some of your code so I
can better understand what you are trying to do.

Steve



 -Original Message-
 From: Cristiano Moreira Silva [mailto:[EMAIL PROTECTED]
 Sent: June 29, 2003 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Submiting a form through a link


 First of all, thanks for helping me, but I've one
 doubt: in the example
 below (the one you sent me), you aren't using
 html:link but html:hidden
 instead.  Where I put my link reference? Thanks again.

  html:form action=/path
  html:hidden property=action value=MyAction/
  /html:form

 - Original Message -
 From: Steve Raeburn [EMAIL PROTECTED]
 To: Struts Users Mailing List
 [EMAIL PROTECTED]
 Sent: Saturday, June 28, 2003 6:17 PM
 Subject: RE: Submiting a form through a link


a href=
 onclick=document.forms[0].submit();return
 false;Click
  here/a
(or the equivalent using Struts html:link tag.)
 
html:form action=/path
  html:hidden property=action
 value=MyAction/
/html:form
 
  The above code works for me. Not sure if the return
 false; has any
 impact -
  probably does nothing.
  Do you have more than one form on the page? You
 might need to change the
  forms[] index number.
  You can also try using the form name (which is the
 same as defined in
  struts-config.xml) e.g.
 
document.forms['testForm'].submit()
 
  If that doesn't work then please post more of your
 form  link code.
 
  Steve
 
  p.s. Don't forget that if your users don't have
 javascript enabled then
 they
  won't be able to use this feature of your site. ;-)
 
   -Original Message-
   From: Cristiano Moreira Silva
 [mailto:[EMAIL PROTECTED]
   Sent: June 28, 2003 12:02 PM
   To: Struts Users Mailing List
   Subject: Submiting a form through a link
  
  
   Hello. I'm trying to submit a html:form through a
   html:link. When I click the link, on the onclick
   event, I call a javascript function and execute:
  
   document.forms[0].submit()
  
   Then nothing happens.
  
   Can someone send me a simple example (or a URL to
 it)
   of submiting a html:form through html:link?
 Thanks.
  
  
  
   =
  
 
   Cristiano Moreira Silva
   Site - http://computologo.vila.bol.com.br
   E-mail - [EMAIL PROTECTED]
   Tudo posso nAquele que me fortalece. Fp. 4:13
  
  
 ___
   Yahoo! Mail
   Mais espaço, mais segurança e gratuito: caixa
 postal de 6MB,
   antivírus, proteção contra spam.
   http://br.mail.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]




 =
 
 Cristiano Moreira Silva
 Site - http://computologo.vila.bol.com.br
 E-mail - [EMAIL PROTECTED]
 Tudo posso nAquele que me fortalece. Fp. 4:13

 ___
 Yahoo! Mail
 Mais espaço, mais segurança e gratuito: caixa postal de 6MB,
 antivírus, proteção contra spam.
 http://br.mail.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]



Re: Submiting a form through a link

2003-06-29 Thread Cristiano Moreira Silva
It's just something like this:

function go()
document.forms[0].submit();
}

html:form action=/some_action
html:select property=choice value=1
html:option value=1/
html:option value=2/
html:option value=3/
html:option value=4/
/html:select

   html:link href= onclick=javascript:go()[ ok
]/html:link
/html:form

What's wrong with this implementation. It happens
nothing when I click in
the [ ok ] link.
But I'll try your tip. Thanks.

- Original Message -
From: Steve Raeburn [EMAIL PROTECTED]
To: Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Sunday, June 29, 2003 2:20 PM
Subject: RE: Submiting a form through a link


 You don't need to use html:link because the link
doesn't actually link
to
 anything, it just triggers the form submission. The
path to your action is
 actually in the html:form tag. The parameters that
would normally be
added
 to the URL are specified in the hidden fields.

 If that's still not clear it would help if you
posted some of your code so
I
 can better understand what you are trying to do.

 Steve



  -Original Message-
  From: Cristiano Moreira Silva
[mailto:[EMAIL PROTECTED]
  Sent: June 29, 2003 9:14 AM
  To: [EMAIL PROTECTED]
  Subject: Re: Submiting a form through a link
 
 
  First of all, thanks for helping me, but I've one
  doubt: in the example
  below (the one you sent me), you aren't using
  html:link but html:hidden
  instead.  Where I put my link reference? Thanks
again.
 
   html:form action=/path
   html:hidden property=action
value=MyAction/
   /html:form
 
  - Original Message -
  From: Steve Raeburn [EMAIL PROTECTED]
  To: Struts Users Mailing List
  [EMAIL PROTECTED]
  Sent: Saturday, June 28, 2003 6:17 PM
  Subject: RE: Submiting a form through a link
 
 
 a href=
  onclick=document.forms[0].submit();return
  false;Click
   here/a
 (or the equivalent using Struts html:link
tag.)
  
 html:form action=/path
   html:hidden property=action
  value=MyAction/
 /html:form
  
   The above code works for me. Not sure if the
return
  false; has any
  impact -
   probably does nothing.
   Do you have more than one form on the page? You
  might need to change the
   forms[] index number.
   You can also try using the form name (which is
the
  same as defined in
   struts-config.xml) e.g.
  
 document.forms['testForm'].submit()
  
   If that doesn't work then please post more of
your
  form  link code.
  
   Steve
  
   p.s. Don't forget that if your users don't have
  javascript enabled then
  they
   won't be able to use this feature of your site.
;-)
  
-Original Message-
From: Cristiano Moreira Silva
  [mailto:[EMAIL PROTECTED]
Sent: June 28, 2003 12:02 PM
To: Struts Users Mailing List
Subject: Submiting a form through a link
   
   
Hello. I'm trying to submit a html:form
through a
html:link. When I click the link, on the
onclick
event, I call a javascript function and
execute:
   
document.forms[0].submit()
   
Then nothing happens.
   
Can someone send me a simple example (or a URL
to
  it)
of submiting a html:form through html:link?
  Thanks.
   
   
   
=
   
 

Cristiano Moreira Silva
Site - http://computologo.vila.bol.com.br
E-mail - [EMAIL PROTECTED]
Tudo posso nAquele que me fortalece. Fp.
4:13
   
   
 
___
Yahoo! Mail
Mais espaço, mais segurança e gratuito: caixa
  postal de 6MB,
antivírus, proteção contra spam.
http://br.mail.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]
 
 
 
 
  =
 

  Cristiano Moreira Silva
  Site - http://computologo.vila.bol.com.br
  E-mail - [EMAIL PROTECTED]
  Tudo posso nAquele que me fortalece. Fp. 4:13
 
 
___
  Yahoo! Mail
  Mais espaço, mais segurança e gratuito: caixa
postal de 6MB,
  antivírus, proteção contra spam.
  http://br.mail.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]




=

Cristiano Moreira Silva
Site - http://computologo.vila.bol.com.br
E-mail - [EMAIL

Re: Submiting a form through a link

2003-06-29 Thread José Ventura
Have you gotten any JS errors when you clicked on it? I believe you
don't need the javascript: part when it's inside an eventhandler
(onXXX), only when it's inside an href.

Try html:link href= onclick=go()[ ok ]/html:link, see if it
works...

HTH

[]'s
- ventura

- Original Message -
From: Cristiano Moreira Silva [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, June 29, 2003 5:12 PM
Subject: Re: Submiting a form through a link


 It's just something like this:

 function go()
 document.forms[0].submit();
 }

 html:form action=/some_action
 html:select property=choice value=1
 html:option value=1/
 html:option value=2/
 html:option value=3/
 html:option value=4/
 /html:select

html:link href= onclick=javascript:go()[ ok
 ]/html:link
 /html:form

 What's wrong with this implementation. It happens
 nothing when I click in
 the [ ok ] link.
 But I'll try your tip. Thanks.

 - Original Message -
 From: Steve Raeburn [EMAIL PROTECTED]
 To: Struts Users Mailing List
 [EMAIL PROTECTED]
 Sent: Sunday, June 29, 2003 2:20 PM
 Subject: RE: Submiting a form through a link


  You don't need to use html:link because the link
 doesn't actually link
 to
  anything, it just triggers the form submission. The
 path to your action is
  actually in the html:form tag. The parameters that
 would normally be
 added
  to the URL are specified in the hidden fields.
 
  If that's still not clear it would help if you
 posted some of your code so
 I
  can better understand what you are trying to do.
 
  Steve
 
 
 
   -Original Message-
   From: Cristiano Moreira Silva
 [mailto:[EMAIL PROTECTED]
   Sent: June 29, 2003 9:14 AM
   To: [EMAIL PROTECTED]
   Subject: Re: Submiting a form through a link
  
  
   First of all, thanks for helping me, but I've one
   doubt: in the example
   below (the one you sent me), you aren't using
   html:link but html:hidden
   instead.  Where I put my link reference? Thanks
 again.
  
html:form action=/path
html:hidden property=action
 value=MyAction/
/html:form
  
   - Original Message -
   From: Steve Raeburn [EMAIL PROTECTED]
   To: Struts Users Mailing List
   [EMAIL PROTECTED]
   Sent: Saturday, June 28, 2003 6:17 PM
   Subject: RE: Submiting a form through a link
  
  
  a href=
   onclick=document.forms[0].submit();return
   false;Click
here/a
  (or the equivalent using Struts html:link
 tag.)
   
  html:form action=/path
html:hidden property=action
   value=MyAction/
  /html:form
   
The above code works for me. Not sure if the
 return
   false; has any
   impact -
probably does nothing.
Do you have more than one form on the page? You
   might need to change the
forms[] index number.
You can also try using the form name (which is
 the
   same as defined in
struts-config.xml) e.g.
   
  document.forms['testForm'].submit()
   
If that doesn't work then please post more of
 your
   form  link code.
   
Steve
   
p.s. Don't forget that if your users don't have
   javascript enabled then
   they
won't be able to use this feature of your site.
 ;-)
   
 -Original Message-
 From: Cristiano Moreira Silva
   [mailto:[EMAIL PROTECTED]
 Sent: June 28, 2003 12:02 PM
 To: Struts Users Mailing List
 Subject: Submiting a form through a link


 Hello. I'm trying to submit a html:form
 through a
 html:link. When I click the link, on the
 onclick
 event, I call a javascript function and
 execute:

 document.forms[0].submit()

 Then nothing happens.

 Can someone send me a simple example (or a URL
 to
   it)
 of submiting a html:form through html:link?
   Thanks.



 =

  
 
 Cristiano Moreira Silva
 Site - http://computologo.vila.bol.com.br
 E-mail - [EMAIL PROTECTED]
 Tudo posso nAquele que me fortalece. Fp.
 4:13


  
 ___
 Yahoo! Mail
 Mais espaço, mais segurança e gratuito: caixa
   postal de 6MB,
 antivírus, proteção contra spam.
 http://br.mail.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]
  
  
  
  
   =
  
 
   Cristiano Moreira Silva
   Site - http://computologo.vila.bol.com.br
   E-mail - [EMAIL PROTECTED]
   Tudo posso nAquele que me fortalece. Fp. 4:13
  
  
 ___
   Yahoo

RE: Submiting a form through a link

2003-06-29 Thread Steve Raeburn
OK, I see now. Try adding return false; at the end of your go() method. I
had it in my example and Matt explained earlier why it works.
As I said, you can just use a standard HTML a tag in this case.

Steve


 -Original Message-
 From: Cristiano Moreira Silva [mailto:[EMAIL PROTECTED]
 Sent: June 29, 2003 1:13 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Submiting a form through a link


 It's just something like this:

 function go()
 document.forms[0].submit();
 }

 html:form action=/some_action
 html:select property=choice value=1
 html:option value=1/
 html:option value=2/
 html:option value=3/
 html:option value=4/
 /html:select

html:link href= onclick=javascript:go()[ ok
 ]/html:link
 /html:form

 What's wrong with this implementation. It happens
 nothing when I click in
 the [ ok ] link.
 But I'll try your tip. Thanks.

 - Original Message -
 From: Steve Raeburn [EMAIL PROTECTED]
 To: Struts Users Mailing List
 [EMAIL PROTECTED]
 Sent: Sunday, June 29, 2003 2:20 PM
 Subject: RE: Submiting a form through a link


  You don't need to use html:link because the link
 doesn't actually link
 to
  anything, it just triggers the form submission. The
 path to your action is
  actually in the html:form tag. The parameters that
 would normally be
 added
  to the URL are specified in the hidden fields.
 
  If that's still not clear it would help if you
 posted some of your code so
 I
  can better understand what you are trying to do.
 
  Steve
 
 
 
   -Original Message-
   From: Cristiano Moreira Silva
 [mailto:[EMAIL PROTECTED]
   Sent: June 29, 2003 9:14 AM
   To: [EMAIL PROTECTED]
   Subject: Re: Submiting a form through a link
  
  
   First of all, thanks for helping me, but I've one
   doubt: in the example
   below (the one you sent me), you aren't using
   html:link but html:hidden
   instead.  Where I put my link reference? Thanks
 again.
  
html:form action=/path
html:hidden property=action
 value=MyAction/
/html:form
  
   - Original Message -
   From: Steve Raeburn [EMAIL PROTECTED]
   To: Struts Users Mailing List
   [EMAIL PROTECTED]
   Sent: Saturday, June 28, 2003 6:17 PM
   Subject: RE: Submiting a form through a link
  
  
  a href=
   onclick=document.forms[0].submit();return
   false;Click
here/a
  (or the equivalent using Struts html:link
 tag.)
   
  html:form action=/path
html:hidden property=action
   value=MyAction/
  /html:form
   
The above code works for me. Not sure if the
 return
   false; has any
   impact -
probably does nothing.
Do you have more than one form on the page? You
   might need to change the
forms[] index number.
You can also try using the form name (which is
 the
   same as defined in
struts-config.xml) e.g.
   
  document.forms['testForm'].submit()
   
If that doesn't work then please post more of
 your
   form  link code.
   
Steve
   
p.s. Don't forget that if your users don't have
   javascript enabled then
   they
won't be able to use this feature of your site.
 ;-)
   
 -Original Message-
 From: Cristiano Moreira Silva
   [mailto:[EMAIL PROTECTED]
 Sent: June 28, 2003 12:02 PM
 To: Struts Users Mailing List
 Subject: Submiting a form through a link


 Hello. I'm trying to submit a html:form
 through a
 html:link. When I click the link, on the
 onclick
 event, I call a javascript function and
 execute:

 document.forms[0].submit()

 Then nothing happens.

 Can someone send me a simple example (or a URL
 to
   it)
 of submiting a html:form through html:link?
   Thanks.



 =

  
 
 Cristiano Moreira Silva
 Site - http://computologo.vila.bol.com.br
 E-mail - [EMAIL PROTECTED]
 Tudo posso nAquele que me fortalece. Fp.
 4:13


  
 ___
 Yahoo! Mail
 Mais espaço, mais segurança e gratuito: caixa
   postal de 6MB,
 antivírus, proteção contra spam.
 http://br.mail.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]
  
  
  
  
   =
  
 
   Cristiano Moreira Silva
   Site - http://computologo.vila.bol.com.br
   E-mail - [EMAIL PROTECTED]
   Tudo posso nAquele que me fortalece. Fp. 4:13
  
  
 ___
   Yahoo! Mail
   Mais espaço, mais segurança e gratuito

RE: Submiting a form through a link

2003-06-29 Thread Steve Raeburn
Good point!

html:form action=/path
html:select property=choice value=1
html:option value=11/html:option
html:option value=22/html:option
html:option value=33/html:option
html:option value=44/html:option
/html:select

/html:form

a href= onclick=document.forms[0].submit();return false;[ ok ]/a
html:link href= onclick=javascript:'document.forms[0].submit();return
false;'[ ok ]/html:link
a href=javascript:document.forms[0].submit()[ ok ]/a

All three versions of the link work. A couple of points to notice:
  - The links don't have to be contained within the form tag. Not sure if
you were under that impression or not, but they don't.
  - The third version uses the 'javascript:' url in href. You don't need the
return false; here because you want the link to activate (it won't actually
work if you do include return false;)

Rhetorical question: What's wrong with a simple button? Then you wouldn't
need to resort to javascript and all users would be able to use the form.

Steve

 -Original Message-
 From: José Ventura [mailto:[EMAIL PROTECTED]
 Sent: June 29, 2003 1:20 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Submiting a form through a link


 Have you gotten any JS errors when you clicked on it? I believe you
 don't need the javascript: part when it's inside an eventhandler
 (onXXX), only when it's inside an href.

 Try html:link href= onclick=go()[ ok ]/html:link, see if it
 works...

 HTH

 []'s
 - ventura

 - Original Message -
 From: Cristiano Moreira Silva [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, June 29, 2003 5:12 PM
 Subject: Re: Submiting a form through a link


  It's just something like this:
 
  function go()
  document.forms[0].submit();
  }
 
  html:form action=/some_action
  html:select property=choice value=1
  html:option value=1/
  html:option value=2/
  html:option value=3/
  html:option value=4/
  /html:select
 
 html:link href= onclick=javascript:go()[ ok
  ]/html:link
  /html:form
 
  What's wrong with this implementation. It happens
  nothing when I click in
  the [ ok ] link.
  But I'll try your tip. Thanks.
 
  - Original Message -
  From: Steve Raeburn [EMAIL PROTECTED]
  To: Struts Users Mailing List
  [EMAIL PROTECTED]
  Sent: Sunday, June 29, 2003 2:20 PM
  Subject: RE: Submiting a form through a link
 
 
   You don't need to use html:link because the link
  doesn't actually link
  to
   anything, it just triggers the form submission. The
  path to your action is
   actually in the html:form tag. The parameters that
  would normally be
  added
   to the URL are specified in the hidden fields.
  
   If that's still not clear it would help if you
  posted some of your code so
  I
   can better understand what you are trying to do.
  
   Steve
  
  
  
-Original Message-
From: Cristiano Moreira Silva
  [mailto:[EMAIL PROTECTED]
Sent: June 29, 2003 9:14 AM
To: [EMAIL PROTECTED]
Subject: Re: Submiting a form through a link
   
   
First of all, thanks for helping me, but I've one
doubt: in the example
below (the one you sent me), you aren't using
html:link but html:hidden
instead.  Where I put my link reference? Thanks
  again.
   
 html:form action=/path
 html:hidden property=action
  value=MyAction/
 /html:form
   
- Original Message -
From: Steve Raeburn [EMAIL PROTECTED]
To: Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 6:17 PM
Subject: RE: Submiting a form through a link
   
   
   a href=
onclick=document.forms[0].submit();return
false;Click
 here/a
   (or the equivalent using Struts html:link
  tag.)

   html:form action=/path
 html:hidden property=action
value=MyAction/
   /html:form

 The above code works for me. Not sure if the
  return
false; has any
impact -
 probably does nothing.
 Do you have more than one form on the page? You
might need to change the
 forms[] index number.
 You can also try using the form name (which is
  the
same as defined in
 struts-config.xml) e.g.

   document.forms['testForm'].submit()

 If that doesn't work then please post more of
  your
form  link code.

 Steve

 p.s. Don't forget that if your users don't have
javascript enabled then
they
 won't be able to use this feature of your site.
  ;-)

  -Original Message-
  From: Cristiano Moreira Silva
[mailto:[EMAIL PROTECTED]
  Sent: June 28, 2003 12:02 PM
  To: Struts Users Mailing List
  Subject: Submiting a form through a link
 
 
  Hello. I'm trying to submit a html:form
  through a
  html:link. When I click the link, on the
  onclick
  event, I call a javascript function and
  execute:
 
  document.forms[0].submit()
 
  Then nothing happens

Re: Submiting a form through a link

2003-06-29 Thread Cristiano Moreira Silva
Hey! Thank you everybody who help me! It works now.



- Original Message -
From: Steve Raeburn [EMAIL PROTECTED]
To: Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Sunday, June 29, 2003 5:50 PM
Subject: RE: Submiting a form through a link


 Good point!

 html:form action=/path
 html:select property=choice value=1
 html:option value=11/html:option
 html:option value=22/html:option
 html:option value=33/html:option
 html:option value=44/html:option
 /html:select

 /html:form

 a href=
onclick=document.forms[0].submit();return false;[
ok ]/a
 html:link href=
onclick=javascript:'document.forms[0].submit();return
 false;'[ ok ]/html:link
 a href=javascript:document.forms[0].submit()[ ok
]/a

 All three versions of the link work. A couple of
points to notice:
   - The links don't have to be contained within the
form tag. Not sure if
 you were under that impression or not, but they
don't.
   - The third version uses the 'javascript:' url in
href. You don't need
the
 return false; here because you want the link to
activate (it won't
actually
 work if you do include return false;)

 Rhetorical question: What's wrong with a simple
button? Then you wouldn't
 need to resort to javascript and all users would be
able to use the form.

 Steve

  -Original Message-
  From: José Ventura [mailto:[EMAIL PROTECTED]
  Sent: June 29, 2003 1:20 PM
  To: [EMAIL PROTECTED]
  Subject: Re: Submiting a form through a link
 
 
  Have you gotten any JS errors when you clicked on
it? I believe you
  don't need the javascript: part when it's inside
an eventhandler
  (onXXX), only when it's inside an href.
 
  Try html:link href= onclick=go()[ ok
]/html:link, see if it
  works...
 
  HTH
 
  []'s
  - ventura
 
  - Original Message -
  From: Cristiano Moreira Silva
[EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Sunday, June 29, 2003 5:12 PM
  Subject: Re: Submiting a form through a link
 
 
   It's just something like this:
  
   function go()
   document.forms[0].submit();
   }
  
   html:form action=/some_action
   html:select property=choice value=1
   html:option value=1/
   html:option value=2/
   html:option value=3/
   html:option value=4/
   /html:select
  
  html:link href=
onclick=javascript:go()[ ok
   ]/html:link
   /html:form
  
   What's wrong with this implementation. It
happens
   nothing when I click in
   the [ ok ] link.
   But I'll try your tip. Thanks.
  
   - Original Message -
   From: Steve Raeburn [EMAIL PROTECTED]
   To: Struts Users Mailing List
   [EMAIL PROTECTED]
   Sent: Sunday, June 29, 2003 2:20 PM
   Subject: RE: Submiting a form through a link
  
  
You don't need to use html:link because the
link
   doesn't actually link
   to
anything, it just triggers the form
submission. The
   path to your action is
actually in the html:form tag. The
parameters that
   would normally be
   added
to the URL are specified in the hidden fields.
   
If that's still not clear it would help if you
   posted some of your code so
   I
can better understand what you are trying to
do.
   
Steve
   
   
   
 -Original Message-
 From: Cristiano Moreira Silva
   [mailto:[EMAIL PROTECTED]
 Sent: June 29, 2003 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Submiting a form through a link


 First of all, thanks for helping me, but
I've one
 doubt: in the example
 below (the one you sent me), you aren't
using
 html:link but html:hidden
 instead.  Where I put my link reference?
Thanks
   again.

  html:form action=/path
  html:hidden property=action
   value=MyAction/
  /html:form

 - Original Message -
 From: Steve Raeburn [EMAIL PROTECTED]
 To: Struts Users Mailing List
 [EMAIL PROTECTED]
 Sent: Saturday, June 28, 2003 6:17 PM
 Subject: RE: Submiting a form through a link


a href=
 onclick=document.forms[0].submit();return
 false;Click
  here/a
(or the equivalent using Struts
html:link
   tag.)
 
html:form action=/path
  html:hidden property=action
 value=MyAction/
/html:form
 
  The above code works for me. Not sure if
the
   return
 false; has any
 impact -
  probably does nothing.
  Do you have more than one form on the
page? You
 might need to change the
  forms[] index number.
  You can also try using the form name
(which is
   the
 same as defined in
  struts-config.xml) e.g.
 
document.forms['testForm'].submit()
 
  If that doesn't work then please post more
of
   your
 form  link code.
 
  Steve
 
  p.s. Don't forget that if your users don't
have
 javascript enabled then
 they
  won't be able to use this feature of your
site.
   ;-)
 
   -Original Message-
   From: Cristiano

Submiting a form through a link

2003-06-28 Thread Cristiano Moreira Silva
Hello. I'm trying to submit a html:form through a
html:link. When I click the link, on the onclick
event, I call a javascript function and execute:

document.forms[0].submit()

Then nothing happens.

Can someone send me a simple example (or a URL to it)
of submiting a html:form through html:link? Thanks.



=

Cristiano Moreira Silva
Site - http://computologo.vila.bol.com.br
E-mail - [EMAIL PROTECTED]
Tudo posso nAquele que me fortalece. Fp. 4:13

___
Yahoo! Mail
Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção 
contra spam.
http://br.mail.yahoo.com/

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



RE: Submiting a form through a link

2003-06-28 Thread Steve Raeburn
  a href= onclick=document.forms[0].submit();return false;Click
here/a
  (or the equivalent using Struts html:link tag.)

  html:form action=/path
html:hidden property=action value=MyAction/
  /html:form

The above code works for me. Not sure if the return false; has any impact -
probably does nothing.
Do you have more than one form on the page? You might need to change the
forms[] index number.
You can also try using the form name (which is the same as defined in
struts-config.xml) e.g.

  document.forms['testForm'].submit()

If that doesn't work then please post more of your form  link code.

Steve

p.s. Don't forget that if your users don't have javascript enabled then they
won't be able to use this feature of your site. ;-)

 -Original Message-
 From: Cristiano Moreira Silva [mailto:[EMAIL PROTECTED]
 Sent: June 28, 2003 12:02 PM
 To: Struts Users Mailing List
 Subject: Submiting a form through a link


 Hello. I'm trying to submit a html:form through a
 html:link. When I click the link, on the onclick
 event, I call a javascript function and execute:

 document.forms[0].submit()

 Then nothing happens.

 Can someone send me a simple example (or a URL to it)
 of submiting a html:form through html:link? Thanks.



 =
 
 Cristiano Moreira Silva
 Site - http://computologo.vila.bol.com.br
 E-mail - [EMAIL PROTECTED]
 Tudo posso nAquele que me fortalece. Fp. 4:13

 ___
 Yahoo! Mail
 Mais espaço, mais segurança e gratuito: caixa postal de 6MB,
 antivírus, proteção contra spam.
 http://br.mail.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]