RE: Submit Using html:link and html:javascript

2002-10-28 Thread Madel,Kurt
If anyone is interested, I figured this out.  Of course this is a basic
JavaScript problem so I understand not getting a response on the Struts
list.  Never the less, I feel that it pertains enough for a solution to be
submitted.  

onSubmit is not called if you use JavaScript to submit a form.  Rather, you
must call it yourself.  So an html:link that submits a form, and used the
Struts Validator client side JavaScript might look like:

html:link href=# onclick=javascript:if
(document.forms[0].onsubmit())document.forms[0].submit()
Submit bean:write name=project property=title /
/html:link

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: Madel,Kurt [mailto:kmadel;csmi.com] 
Sent: Thursday, October 24, 2002 9:55 AM
To: 'Struts Users Mailing List'
Subject: Submit Using html:link and html:javascript

This may seem somewhat trivial.  Never the less, look and feel is very
important to a web site.  Before using Struts, we have always used
hyperlinks to submit forms.  I am able to submit a Struts html:form with
an html:link tag, but it bypasses the client side validation created by
the Validation plug-in.  The client side validation works fine if I use an
html:submit button.  I would be greatly appreciative to hear if and how
anyone has gotten the html:link and client side html:javascript tags to
work together in submitting an html:form.

I am using the struts.jar from the 10/22 nightly build.

Thanks

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: Submit Using html:link and html:javascript

2002-10-28 Thread David Graham
I don't think it's a good idea to use hyperlinks for form submission but I'm 
glad you got it to work.

David






From: Madel,Kurt [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript
Date: Mon, 28 Oct 2002 14:54:47 -0500

If anyone is interested, I figured this out.  Of course this is a basic
JavaScript problem so I understand not getting a response on the Struts
list.  Never the less, I feel that it pertains enough for a solution to be
submitted.

onSubmit is not called if you use JavaScript to submit a form.  Rather, you
must call it yourself.  So an html:link that submits a form, and used the
Struts Validator client side JavaScript might look like:

html:link href=# onclick=javascript:if
(document.forms[0].onsubmit())document.forms[0].submit()
	Submit bean:write name=project property=title /
/html:link

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: Madel,Kurt [mailto:kmadel;csmi.com]
Sent: Thursday, October 24, 2002 9:55 AM
To: 'Struts Users Mailing List'
Subject: Submit Using html:link and html:javascript

This may seem somewhat trivial.  Never the less, look and feel is very
important to a web site.  Before using Struts, we have always used
hyperlinks to submit forms.  I am able to submit a Struts html:form with
an html:link tag, but it bypasses the client side validation created by
the Validation plug-in.  The client side validation works fine if I use an
html:submit button.  I would be greatly appreciative to hear if and how
anyone has gotten the html:link and client side html:javascript tags to
work together in submitting an html:form.

I am using the struts.jar from the 10/22 nightly build.

Thanks

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Unlimited Internet access -- and 2 months free!  Try MSN. 
http://resourcecenter.msn.com/access/plans/2monthsfree.asp


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org



RE: Submit Using html:link and html:javascript

2002-10-28 Thread Madel,Kurt
Yes, I suppose so but the powers beyond me like the way they look.  On the
plus side, you can then use a link for cancel that href's an action.

Also, this would work well if you wanted to use an image for submit
purposes.

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com] 
Sent: Monday, October 28, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript

I don't think it's a good idea to use hyperlinks for form submission but I'm

glad you got it to work.

David






From: Madel,Kurt [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript
Date: Mon, 28 Oct 2002 14:54:47 -0500

If anyone is interested, I figured this out.  Of course this is a basic
JavaScript problem so I understand not getting a response on the Struts
list.  Never the less, I feel that it pertains enough for a solution to be
submitted.

onSubmit is not called if you use JavaScript to submit a form.  Rather, you
must call it yourself.  So an html:link that submits a form, and used the
Struts Validator client side JavaScript might look like:

html:link href=# onclick=javascript:if
(document.forms[0].onsubmit())document.forms[0].submit()
   Submit bean:write name=project property=title /
/html:link

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: Madel,Kurt [mailto:kmadel;csmi.com]
Sent: Thursday, October 24, 2002 9:55 AM
To: 'Struts Users Mailing List'
Subject: Submit Using html:link and html:javascript

This may seem somewhat trivial.  Never the less, look and feel is very
important to a web site.  Before using Struts, we have always used
hyperlinks to submit forms.  I am able to submit a Struts html:form with
an html:link tag, but it bypasses the client side validation created by
the Validation plug-in.  The client side validation works fine if I use an
html:submit button.  I would be greatly appreciative to hear if and how
anyone has gotten the html:link and client side html:javascript tags to
work together in submitting an html:form.

I am using the struts.jar from the 10/22 nightly build.

Thanks

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Unlimited Internet access -- and 2 months free!  Try MSN. 
http://resourcecenter.msn.com/access/plans/2monthsfree.asp


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: Submit Using html:link and html:javascript

2002-10-28 Thread Madel,Kurt
Is there a struts tags for an input image?

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com] 
Sent: Monday, October 28, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript

You can use an input element for image submit buttons.  You don't need a 
link around an image.

David






From: Madel,Kurt [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript
Date: Mon, 28 Oct 2002 15:14:58 -0500

Yes, I suppose so but the powers beyond me like the way they look.  On the
plus side, you can then use a link for cancel that href's an action.

Also, this would work well if you wanted to use an image for submit
purposes.

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com]
Sent: Monday, October 28, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript

I don't think it's a good idea to use hyperlinks for form submission but 
I'm

glad you got it to work.

David






 From: Madel,Kurt [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Submit Using html:link and html:javascript
 Date: Mon, 28 Oct 2002 14:54:47 -0500
 
 If anyone is interested, I figured this out.  Of course this is a basic
 JavaScript problem so I understand not getting a response on the Struts
 list.  Never the less, I feel that it pertains enough for a solution to 
be
 submitted.
 
 onSubmit is not called if you use JavaScript to submit a form.  Rather, 
you
 must call it yourself.  So an html:link that submits a form, and used 
the
 Struts Validator client side JavaScript might look like:
 
 html:link href=# onclick=javascript:if
 (document.forms[0].onsubmit())document.forms[0].submit()
  Submit bean:write name=project property=title /
 /html:link
 
 Kurt Madel
 Programmer, CSMi
 (703) 823-4300 ext. 170
 
 
 -Original Message-
 From: Madel,Kurt [mailto:kmadel;csmi.com]
 Sent: Thursday, October 24, 2002 9:55 AM
 To: 'Struts Users Mailing List'
 Subject: Submit Using html:link and html:javascript
 
 This may seem somewhat trivial.  Never the less, look and feel is very
 important to a web site.  Before using Struts, we have always used
 hyperlinks to submit forms.  I am able to submit a Struts html:form 
with
 an html:link tag, but it bypasses the client side validation created by
 the Validation plug-in.  The client side validation works fine if I use 
an
 html:submit button.  I would be greatly appreciative to hear if and how
 anyone has gotten the html:link and client side html:javascript tags 
to
 work together in submitting an html:form.
 
 I am using the struts.jar from the 10/22 nightly build.
 
 Thanks
 
 Kurt Madel
 Programmer, CSMi
 (703) 823-4300 ext. 170
 
 
 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org
 
 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org


_
Unlimited Internet access -- and 2 months free!  Try MSN.
http://resourcecenter.msn.com/access/plans/2monthsfree.asp


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Broadband? Dial-up? Get reliable MSN Internet Access. 
http://resourcecenter.msn.com/access/plans/default.asp


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: Submit Using html:link and html:javascript

2002-10-28 Thread David Graham
http://jakarta.apache.org/struts/userGuide/struts-html.html#image

In the future, check the users guide first.

David



From: Madel,Kurt [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript
Date: Mon, 28 Oct 2002 15:51:21 -0500

Is there a struts tags for an input image?

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com]
Sent: Monday, October 28, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript

You can use an input element for image submit buttons.  You don't need a
link around an image.

David






From: Madel,Kurt [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript
Date: Mon, 28 Oct 2002 15:14:58 -0500

Yes, I suppose so but the powers beyond me like the way they look.  On 
the
plus side, you can then use a link for cancel that href's an action.

Also, this would work well if you wanted to use an image for submit
purposes.

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com]
Sent: Monday, October 28, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: RE: Submit Using html:link and html:javascript

I don't think it's a good idea to use hyperlinks for form submission but
I'm

glad you got it to work.

David






 From: Madel,Kurt [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Submit Using html:link and html:javascript
 Date: Mon, 28 Oct 2002 14:54:47 -0500
 
 If anyone is interested, I figured this out.  Of course this is a basic
 JavaScript problem so I understand not getting a response on the Struts
 list.  Never the less, I feel that it pertains enough for a solution to
be
 submitted.
 
 onSubmit is not called if you use JavaScript to submit a form.  Rather,
you
 must call it yourself.  So an html:link that submits a form, and used
the
 Struts Validator client side JavaScript might look like:
 
 html:link href=# onclick=javascript:if
 (document.forms[0].onsubmit())document.forms[0].submit()
 	Submit bean:write name=project property=title /
 /html:link
 
 Kurt Madel
 Programmer, CSMi
 (703) 823-4300 ext. 170
 
 
 -Original Message-
 From: Madel,Kurt [mailto:kmadel;csmi.com]
 Sent: Thursday, October 24, 2002 9:55 AM
 To: 'Struts Users Mailing List'
 Subject: Submit Using html:link and html:javascript
 
 This may seem somewhat trivial.  Never the less, look and feel is very
 important to a web site.  Before using Struts, we have always used
 hyperlinks to submit forms.  I am able to submit a Struts html:form
with
 an html:link tag, but it bypasses the client side validation created 
by
 the Validation plug-in.  The client side validation works fine if I use
an
 html:submit button.  I would be greatly appreciative to hear if and 
how
 anyone has gotten the html:link and client side html:javascript 
tags
to
 work together in submitting an html:form.
 
 I am using the struts.jar from the 10/22 nightly build.
 
 Thanks
 
 Kurt Madel
 Programmer, CSMi
 (703) 823-4300 ext. 170
 
 
 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org
 
 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org


_
Unlimited Internet access -- and 2 months free!  Try MSN.
http://resourcecenter.msn.com/access/plans/2monthsfree.asp


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


_
Broadband? Dial-up? Get reliable MSN Internet Access.
http://resourcecenter.msn.com/access/plans/default.asp


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Unlimited Internet access -- and 2 months free!  Try MSN. 
http://resourcecenter.msn.com/access/plans/2monthsfree.asp


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts

RE: Submit Using html:link and html:javascript

2002-10-28 Thread Wendy Smoak
 Is there a struts tags for an input image?

Assuming you mean a SUBMIT button with an image on it instead of text,
here's what I'm using:

html-el:submit property=submit  onclick=setAction('Add Prospect');
styleClass=addButton titleKey=button.add.prospect value= /

And here's the style that goes with it:

.addButton {
background-image:url(images/add.gif);
background-position:center;
background-repeat:no-repeat;
background-color:lt grey
}

The setAction javascript is necessary because you can't have a value
without the text appearing on the button.  (Or, I couldn't figure out how.)
So I put a value into the hidden 'action' form field and then use that in a
LookupDispatchAction:

function setAction(target) {document.forms[0].action.value=target;}

It took a long time to piece all this together.  Hope it helps someone else!

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management