You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leticia Golubov <lg...@micromuse.com> on 2004/01/19 12:19:38 UTC

html:form/Submit question....

I have a form and my plan is to set all the fields (using DynaActionForm)
when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
action to submit it, but an image, the code I have at the moment is:

<html:form action="/addNewScope">

..... lots of other code here

<a onclick ??? (What goes here) ????
    onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
    onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
    onMouseOut="SwapImage('ok','../../images/button_ok.png');"
    onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
    <img name="ok" src="../../images/button_ok.png" border="0" width="42"
height="23">
</a>

..... more code here

</html:form>

basically, I want the action in the form (addNewScope) to be submited when I
do onclick (where the question marks are).  I don't want to use Javascript,
I want call the action...  I have done this before using <html:submit> but
this is not what I'm trying to achieve here.

I think I might be confused... :-/

regards

Leticia


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


RE: Why can't I name a form using html:form?

Posted by Leticia Golubov <lg...@micromuse.com>.
Thanks Mark,

I stumbled upon the answer to my question by accident, yesterday, which made
me quite happy (must get out more)... :)

cheers

-----Original Message-----
From: Mark Lowe [mailto:mark.lowe@talk21.com]
Sent: 24 February 2004 12:41
To: Struts Users Mailing List
Subject: Re: Why can't I name a form using html:form?


styleId will give you a hook if you need have a way of drilling to
something. But i'm guessing what your needs are.


On 24 Feb 2004, at 13:38, Mark Lowe wrote:

> the name of the form will be whatever you called it in struts config.
> There was a name attribute in 1.0 but this became deprecated and now
> must have been removed.
>
> I imagine that something will be done in newer releases (perhaps
> already) to support strict xhtml and thus do away with rendering
> name="" and use id="" instead or as well as name="".
>
> If you're trying to drill to the form in javascript best use
>
> onclick="alert( this.form.elements['myproperty'].value )" ..
>
> I you look at the rendered html you'll see that the name attribute is
> rendered.
>
>
> On 24 Feb 2004, at 13:30, Leticia Golubov wrote:
>
>> This is really winding me up...
>>
>> why does <html:form method="post" action="/scopeAction" > work
>>
>> but <html:form method="post" action="/scopeAction"
>> 					name="deleteForm"
>> 					type="org.apache.struts.action.DynaActionForm" >
>> doesn't?
>>
>> Why can't I name my forms?  I've looked at the documentation and the
>> 'name'
>> field doesn't even seem to exist, which leads me to believe I can't
>> name
>> forms using the html:form tag?!
>>
>> Is this a bug in Struts or have I missed something fundamental here?
>>
>> regards
>>
>> Leticia
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


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


Re: Why can't I name a form using html:form?

Posted by Mark Lowe <ma...@talk21.com>.
styleId will give you a hook if you need have a way of drilling to 
something. But i'm guessing what your needs are.


On 24 Feb 2004, at 13:38, Mark Lowe wrote:

> the name of the form will be whatever you called it in struts config. 
> There was a name attribute in 1.0 but this became deprecated and now 
> must have been removed.
>
> I imagine that something will be done in newer releases (perhaps 
> already) to support strict xhtml and thus do away with rendering 
> name="" and use id="" instead or as well as name="".
>
> If you're trying to drill to the form in javascript best use
>
> onclick="alert( this.form.elements['myproperty'].value )" ..
>
> I you look at the rendered html you'll see that the name attribute is 
> rendered.
>
>
> On 24 Feb 2004, at 13:30, Leticia Golubov wrote:
>
>> This is really winding me up...
>>
>> why does <html:form method="post" action="/scopeAction" > work
>>
>> but <html:form method="post" action="/scopeAction"
>> 					name="deleteForm"
>> 					type="org.apache.struts.action.DynaActionForm" >
>> doesn't?
>>
>> Why can't I name my forms?  I've looked at the documentation and the 
>> 'name'
>> field doesn't even seem to exist, which leads me to believe I can't 
>> name
>> forms using the html:form tag?!
>>
>> Is this a bug in Struts or have I missed something fundamental here?
>>
>> regards
>>
>> Leticia
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: Why can't I name a form using html:form?

Posted by Mark Lowe <ma...@talk21.com>.
the name of the form will be whatever you called it in struts config. 
There was a name attribute in 1.0 but this became deprecated and now 
must have been removed.

I imagine that something will be done in newer releases (perhaps 
already) to support strict xhtml and thus do away with rendering 
name="" and use id="" instead or as well as name="".

If you're trying to drill to the form in javascript best use

onclick="alert( this.form.elements['myproperty'].value )" ..

I you look at the rendered html you'll see that the name attribute is 
rendered.


On 24 Feb 2004, at 13:30, Leticia Golubov wrote:

> This is really winding me up...
>
> why does <html:form method="post" action="/scopeAction" > work
>
> but <html:form method="post" action="/scopeAction"
> 					name="deleteForm"
> 					type="org.apache.struts.action.DynaActionForm" >
> doesn't?
>
> Why can't I name my forms?  I've looked at the documentation and the 
> 'name'
> field doesn't even seem to exist, which leads me to believe I can't 
> name
> forms using the html:form tag?!
>
> Is this a bug in Struts or have I missed something fundamental here?
>
> regards
>
> Leticia
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Why can't I name a form using html:form?

Posted by Leticia Golubov <lg...@micromuse.com>.
This is really winding me up...

why does <html:form method="post" action="/scopeAction" > work

but <html:form method="post" action="/scopeAction"
					name="deleteForm"
					type="org.apache.struts.action.DynaActionForm" >
doesn't?

Why can't I name my forms?  I've looked at the documentation and the 'name'
field doesn't even seem to exist, which leads me to believe I can't name
forms using the html:form tag?!

Is this a bug in Struts or have I missed something fundamental here?

regards

Leticia


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


RE: html:form/Submit question....

Posted by Leticia Golubov <lg...@micromuse.com>.
Yes, fair enough, but I should be able to refer to the form by name, surely?
Anyway, I got that working (and I am naming the form), thanks everyone for
the suggestions and help! :)

-----Original Message-----
From: Eric Bariaux [mailto:ebariaux@skynet.be]
Sent: 19 January 2004 17:26
To: 'Struts Users Mailing List'
Subject: RE: html:form/Submit question....


No you don't always need the name of the form.
If you're 100% sure you always have one form, something like
document.forms[0].submit should work fine.

> -----Original Message-----
> From: Leticia Golubov [mailto:lgolubov@micromuse.com]
> Sent: Monday, January 19, 2004 5:36 PM
> To: Struts Users Mailing List
> Subject: RE: html:form/Submit question....
>
> Also, when I just use the tag: <html:form method="POST"
> action="/addNewScope">
> the page loads correctly, once I use:
> <html:form method="post" action="/addNewScope" name="submitForm"
> type="org.apache.struts.action.DynaActionForm" enctype="text/html">
> I get error below...
>
> but, of course, I need to name the form, otherwise I can't call it
from
> javascript...
>
>
> -----Original Message-----
> From: Leticia Golubov [mailto:lgolubov@micromuse.com]
> Sent: 19 January 2004 16:16
> To: Struts Users Mailing List
> Subject: RE: html:form/Submit question....
>
>
> mmm, think I'm nearly there, but getting Error Report:
>
> org.apache.jasper.JasperException: Cannot find bean under name
> org.apache.struts.taglib.html.BEAN
> 	at
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va
> :2
> 54)
> 	at
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> 	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
> which is rather strange considering I have a very similar piece of
code
> somewhere which runs perfectly fine... :-0
>
> Here's the code which should, in theory, submit the addNewScope action
> when
> image is clicked on:
> <html:form method="post" action="/addNewScope" name="submitForm"
> type="org.apache.struts.action.DynaActionForm" enctype="text/html">
> 	<a onclick="javascript:void(document.submitForm.submit());"
> href="javascript:void(0);"
>
> 	onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
>
>
onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
>
onMouseOut="SwapImage('ok','../../images/button_ok.png');"
>
> 	onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
> 		<img name="ok" src="../../images/button_ok.png"
border="0"
> width="42"
> height="23">
> 	</a>
> </html:form>
>
> Note that somewhere else in the same app (and directory) I have
another
> jsp
> using a DynaActionForm, so my app should be able to access that
dynamic
> Action form.  Mind you, it's not even getting that far.  The page is
not
> even loading the form controls...  Been racking my brains for last
couple
> of
> hours on this one, I've given up now...
>
> Any clues welcomed!!!!
>
> -----Original Message-----
> From: Thomas Cornet [mailto:thomas@cornet.name]
> Sent: 19 January 2004 12:13
> To: Struts Users Mailing List
> Subject: Re: html:form/Submit question....
>
>
>
>
> What I understand from your message is that you want to have a
'dynamic'
> image as a button. An image that changes when the cursor is on the
button,
> or not, which can't be achieved by HTML. The only solution I see is
using
> JavaScript. I don't see why you don't want to use javascript because
you
> use it to change the button's image.
>
> Make something like
>
> <a
> onclick='JavaScript:document.forms[0].submit();'
> href='Javascrip:void(0);'
> onMouseOver.........>
>
> Like this, the form is submitted normally.
>
> Thomas
>
> At 12:19 19/01/2004, you wrote:
> >I have a form and my plan is to set all the fields (using
DynaActionForm)
> >when an ok 'button' is pressed, the problem is, I'm not using a
'submit'
> >action to submit it, but an image, the code I have at the moment is:
> >
> >..... lots of other code here
> >[]
> > ..... more code here basically, I want the action in the form
> > (addNewScope) to be submited when I do onclick (where the question
marks
> > are). I don't want to use Javascript, I want call the action... I
have
> > done this before using but this is not what I'm trying to achieve
here.
> I
> > think I might be confused... :-/ regards Leticia
> >
--------------------------------------------------------------------- To
> > unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For
> > additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>




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


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


RE: html:form/Submit question....

Posted by Eric Bariaux <eb...@skynet.be>.
No you don't always need the name of the form.
If you're 100% sure you always have one form, something like
document.forms[0].submit should work fine.

> -----Original Message-----
> From: Leticia Golubov [mailto:lgolubov@micromuse.com]
> Sent: Monday, January 19, 2004 5:36 PM
> To: Struts Users Mailing List
> Subject: RE: html:form/Submit question....
> 
> Also, when I just use the tag: <html:form method="POST"
> action="/addNewScope">
> the page loads correctly, once I use:
> <html:form method="post" action="/addNewScope" name="submitForm"
> type="org.apache.struts.action.DynaActionForm" enctype="text/html">
> I get error below...
> 
> but, of course, I need to name the form, otherwise I can't call it
from
> javascript...
> 
> 
> -----Original Message-----
> From: Leticia Golubov [mailto:lgolubov@micromuse.com]
> Sent: 19 January 2004 16:16
> To: Struts Users Mailing List
> Subject: RE: html:form/Submit question....
> 
> 
> mmm, think I'm nearly there, but getting Error Report:
> 
> org.apache.jasper.JasperException: Cannot find bean under name
> org.apache.struts.taglib.html.BEAN
> 	at
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va
> :2
> 54)
> 	at
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> 	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 
> which is rather strange considering I have a very similar piece of
code
> somewhere which runs perfectly fine... :-0
> 
> Here's the code which should, in theory, submit the addNewScope action
> when
> image is clicked on:
> <html:form method="post" action="/addNewScope" name="submitForm"
> type="org.apache.struts.action.DynaActionForm" enctype="text/html">
> 	<a onclick="javascript:void(document.submitForm.submit());"
> href="javascript:void(0);"
> 
> 	onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
> 
>
onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
>
onMouseOut="SwapImage('ok','../../images/button_ok.png');"
> 
> 	onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
> 		<img name="ok" src="../../images/button_ok.png"
border="0"
> width="42"
> height="23">
> 	</a>
> </html:form>
> 
> Note that somewhere else in the same app (and directory) I have
another
> jsp
> using a DynaActionForm, so my app should be able to access that
dynamic
> Action form.  Mind you, it's not even getting that far.  The page is
not
> even loading the form controls...  Been racking my brains for last
couple
> of
> hours on this one, I've given up now...
> 
> Any clues welcomed!!!!
> 
> -----Original Message-----
> From: Thomas Cornet [mailto:thomas@cornet.name]
> Sent: 19 January 2004 12:13
> To: Struts Users Mailing List
> Subject: Re: html:form/Submit question....
> 
> 
> 
> 
> What I understand from your message is that you want to have a
'dynamic'
> image as a button. An image that changes when the cursor is on the
button,
> or not, which can't be achieved by HTML. The only solution I see is
using
> JavaScript. I don't see why you don't want to use javascript because
you
> use it to change the button's image.
> 
> Make something like
> 
> <a
> onclick='JavaScript:document.forms[0].submit();'
> href='Javascrip:void(0);'
> onMouseOver.........>
> 
> Like this, the form is submitted normally.
> 
> Thomas
> 
> At 12:19 19/01/2004, you wrote:
> >I have a form and my plan is to set all the fields (using
DynaActionForm)
> >when an ok 'button' is pressed, the problem is, I'm not using a
'submit'
> >action to submit it, but an image, the code I have at the moment is:
> >
> >..... lots of other code here
> >[]
> > ..... more code here basically, I want the action in the form
> > (addNewScope) to be submited when I do onclick (where the question
marks
> > are). I don't want to use Javascript, I want call the action... I
have
> > done this before using but this is not what I'm trying to achieve
here.
> I
> > think I might be confused... :-/ regards Leticia
> >
--------------------------------------------------------------------- To
> > unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For
> > additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 




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


RE: html:form/Submit question....

Posted by Leticia Golubov <lg...@micromuse.com>.
Also, when I just use the tag: <html:form method="POST"
action="/addNewScope">
the page loads correctly, once I use:
<html:form method="post" action="/addNewScope" name="submitForm"
type="org.apache.struts.action.DynaActionForm" enctype="text/html">
I get error below...

but, of course, I need to name the form, otherwise I can't call it from
javascript...


-----Original Message-----
From: Leticia Golubov [mailto:lgolubov@micromuse.com]
Sent: 19 January 2004 16:16
To: Struts Users Mailing List
Subject: RE: html:form/Submit question....


mmm, think I'm nearly there, but getting Error Report:

org.apache.jasper.JasperException: Cannot find bean under name
org.apache.struts.taglib.html.BEAN
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

which is rather strange considering I have a very similar piece of code
somewhere which runs perfectly fine... :-0

Here's the code which should, in theory, submit the addNewScope action when
image is clicked on:
<html:form method="post" action="/addNewScope" name="submitForm"
type="org.apache.struts.action.DynaActionForm" enctype="text/html">
	<a onclick="javascript:void(document.submitForm.submit());"
href="javascript:void(0);"
		onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
		onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
		onMouseOut="SwapImage('ok','../../images/button_ok.png');"
		onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
		<img name="ok" src="../../images/button_ok.png" border="0" width="42"
height="23">
	</a>
</html:form>

Note that somewhere else in the same app (and directory) I have another jsp
using a DynaActionForm, so my app should be able to access that dynamic
Action form.  Mind you, it's not even getting that far.  The page is not
even loading the form controls...  Been racking my brains for last couple of
hours on this one, I've given up now...

Any clues welcomed!!!!

-----Original Message-----
From: Thomas Cornet [mailto:thomas@cornet.name]
Sent: 19 January 2004 12:13
To: Struts Users Mailing List
Subject: Re: html:form/Submit question....




What I understand from your message is that you want to have a 'dynamic'
image as a button. An image that changes when the cursor is on the button,
or not, which can't be achieved by HTML. The only solution I see is using
JavaScript. I don't see why you don't want to use javascript because you
use it to change the button's image.

Make something like

<a
onclick='JavaScript:document.forms[0].submit();'  href='Javascrip:void(0);'
onMouseOver.........>

Like this, the form is submitted normally.

Thomas

At 12:19 19/01/2004, you wrote:
>I have a form and my plan is to set all the fields (using DynaActionForm)
>when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
>action to submit it, but an image, the code I have at the moment is:
>
>..... lots of other code here
>[]
> ..... more code here basically, I want the action in the form
> (addNewScope) to be submited when I do onclick (where the question marks
> are). I don't want to use Javascript, I want call the action... I have
> done this before using but this is not what I'm trying to achieve here. I
> think I might be confused... :-/ regards Leticia
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: struts-user-help@jakarta.apache.org


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


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


RE: html:form/Submit question....

Posted by Leticia Golubov <lg...@micromuse.com>.
mmm, think I'm nearly there, but getting Error Report:

org.apache.jasper.JasperException: Cannot find bean under name
org.apache.struts.taglib.html.BEAN
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

which is rather strange considering I have a very similar piece of code
somewhere which runs perfectly fine... :-0

Here's the code which should, in theory, submit the addNewScope action when
image is clicked on:
<html:form method="post" action="/addNewScope" name="submitForm"
type="org.apache.struts.action.DynaActionForm" enctype="text/html">
	<a onclick="javascript:void(document.submitForm.submit());"
href="javascript:void(0);"
		onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
		onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
		onMouseOut="SwapImage('ok','../../images/button_ok.png');"
		onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
		<img name="ok" src="../../images/button_ok.png" border="0" width="42"
height="23">
	</a>
</html:form>

Note that somewhere else in the same app (and directory) I have another jsp
using a DynaActionForm, so my app should be able to access that dynamic
Action form.  Mind you, it's not even getting that far.  The page is not
even loading the form controls...  Been racking my brains for last couple of
hours on this one, I've given up now...

Any clues welcomed!!!!

-----Original Message-----
From: Thomas Cornet [mailto:thomas@cornet.name]
Sent: 19 January 2004 12:13
To: Struts Users Mailing List
Subject: Re: html:form/Submit question....




What I understand from your message is that you want to have a 'dynamic'
image as a button. An image that changes when the cursor is on the button,
or not, which can't be achieved by HTML. The only solution I see is using
JavaScript. I don't see why you don't want to use javascript because you
use it to change the button's image.

Make something like

<a
onclick='JavaScript:document.forms[0].submit();'  href='Javascrip:void(0);'
onMouseOver.........>

Like this, the form is submitted normally.

Thomas

At 12:19 19/01/2004, you wrote:
>I have a form and my plan is to set all the fields (using DynaActionForm)
>when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
>action to submit it, but an image, the code I have at the moment is:
>
>..... lots of other code here
>[]
> ..... more code here basically, I want the action in the form
> (addNewScope) to be submited when I do onclick (where the question marks
> are). I don't want to use Javascript, I want call the action... I have
> done this before using but this is not what I'm trying to achieve here. I
> think I might be confused... :-/ regards Leticia
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: struts-user-help@jakarta.apache.org


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


Re: html:form/Submit question....

Posted by Thomas Cornet <th...@cornet.name>.

What I understand from your message is that you want to have a 'dynamic' 
image as a button. An image that changes when the cursor is on the button, 
or not, which can't be achieved by HTML. The only solution I see is using 
JavaScript. I don't see why you don't want to use javascript because you 
use it to change the button's image.

Make something like

<a 
onclick='JavaScript:document.forms[0].submit();'  href='Javascrip:void(0);' 
onMouseOver.........>

Like this, the form is submitted normally.

Thomas

At 12:19 19/01/2004, you wrote:
>I have a form and my plan is to set all the fields (using DynaActionForm)
>when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
>action to submit it, but an image, the code I have at the moment is:
>
>..... lots of other code here
>[]
> ..... more code here basically, I want the action in the form 
> (addNewScope) to be submited when I do onclick (where the question marks 
> are). I don't want to use Javascript, I want call the action... I have 
> done this before using but this is not what I'm trying to achieve here. I 
> think I might be confused... :-/ regards Leticia 
> --------------------------------------------------------------------- To 
> unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For 
> additional commands, e-mail: struts-user-help@jakarta.apache.org

RE: html:form/Submit question....

Posted by Andrew Hill <an...@gridnode.com>.
Hmm. Didnt realise that the mouseover didnt work for an input image. Ouch!
Thats a bit of a spanner in the works. :-(

Looks like you need to use javascript submission after all if you want to
keep the mouseover.
Unless any of the other listmembers can see a way that Im missing?

What about having the mouseover attributes set in the parent element of the
input? (Havent tried it myself. Probably wont work.)


-----Original Message-----
From: Leticia Golubov [mailto:lgolubov@micromuse.com]
Sent: Monday, 19 January 2004 20:30
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: RE: html:form/Submit question....


Hiya,

Yes, that works, but the input tag doesn't seem to support the onMouseOver,
etc...

so if I associate an input action with my image as below:

<input name="submit" type="image" src="../../images/button_ok.png" alt="Add
New Scope">

that does submit it correctly... but I can't seem to be able to use my
javascript functions here as onMouseOver, etc are not supported by the input
tag.

Of course the other solution would be to submit the form from a javascript
function but that's far less elegant than the current solution...  Any
suggestions?

Andrew, thanks for pointing me in the right direction. :)


-----Original Message-----
From: Andrew Hill [mailto:andrew.david.hill@gridnode.com]
Sent: 19 January 2004 11:31
To: Struts Users Mailing List
Subject: RE: html:form/Submit question....


<snip>
<a onclick ??? (What goes here) ????
</snip>
JavaScript goes here.

<snip>
I don't want to use Javascript,
</snip>
Um. I think you might be getting a little confused.

<snip>
I think I might be confused... :-/
</snip>
Yes, didnt I just say that?

hehe sorry, couldnt resist ;->

Sounds like what your after is the <input type="image... tag (in struts you
can use <html:image...)
html:
http://webdesign.about.com/library/tags/bltags-inputimage.htm
struts tag:
http://jakarta.apache.org/struts/userGuide/struts-html.html#image

You will still need javascript to do the mouseover effects of course, but it
should degrade ok for users without js (they will still be able to click it
to submit).

hth
Andrew


-----Original Message-----
From: Leticia Golubov [mailto:lgolubov@micromuse.com]
Sent: Monday, 19 January 2004 19:20
To: Struts User Mailing List
Subject: html:form/Submit question....


I have a form and my plan is to set all the fields (using DynaActionForm)
when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
action to submit it, but an image, the code I have at the moment is:

<html:form action="/addNewScope">

..... lots of other code here

<a onclick ??? (What goes here) ????
    onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
    onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
    onMouseOut="SwapImage('ok','../../images/button_ok.png');"
    onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
    <img name="ok" src="../../images/button_ok.png" border="0" width="42"
height="23">
</a>

..... more code here

</html:form>

basically, I want the action in the form (addNewScope) to be submited when I
do onclick (where the question marks are).  I don't want to use Javascript,
I want call the action...  I have done this before using <html:submit> but
this is not what I'm trying to achieve here.

I think I might be confused... :-/

regards

Leticia


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



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



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


RE: html:form/Submit question....

Posted by Leticia Golubov <lg...@micromuse.com>.
Hiya,

Yes, that works, but the input tag doesn't seem to support the onMouseOver,
etc...

so if I associate an input action with my image as below:

<input name="submit" type="image" src="../../images/button_ok.png" alt="Add
New Scope">

that does submit it correctly... but I can't seem to be able to use my
javascript functions here as onMouseOver, etc are not supported by the input
tag.

Of course the other solution would be to submit the form from a javascript
function but that's far less elegant than the current solution...  Any
suggestions?

Andrew, thanks for pointing me in the right direction. :)


-----Original Message-----
From: Andrew Hill [mailto:andrew.david.hill@gridnode.com]
Sent: 19 January 2004 11:31
To: Struts Users Mailing List
Subject: RE: html:form/Submit question....


<snip>
<a onclick ??? (What goes here) ????
</snip>
JavaScript goes here.

<snip>
I don't want to use Javascript,
</snip>
Um. I think you might be getting a little confused.

<snip>
I think I might be confused... :-/
</snip>
Yes, didnt I just say that?

hehe sorry, couldnt resist ;->

Sounds like what your after is the <input type="image... tag (in struts you
can use <html:image...)
html:
http://webdesign.about.com/library/tags/bltags-inputimage.htm
struts tag:
http://jakarta.apache.org/struts/userGuide/struts-html.html#image

You will still need javascript to do the mouseover effects of course, but it
should degrade ok for users without js (they will still be able to click it
to submit).

hth
Andrew


-----Original Message-----
From: Leticia Golubov [mailto:lgolubov@micromuse.com]
Sent: Monday, 19 January 2004 19:20
To: Struts User Mailing List
Subject: html:form/Submit question....


I have a form and my plan is to set all the fields (using DynaActionForm)
when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
action to submit it, but an image, the code I have at the moment is:

<html:form action="/addNewScope">

..... lots of other code here

<a onclick ??? (What goes here) ????
    onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
    onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
    onMouseOut="SwapImage('ok','../../images/button_ok.png');"
    onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
    <img name="ok" src="../../images/button_ok.png" border="0" width="42"
height="23">
</a>

..... more code here

</html:form>

basically, I want the action in the form (addNewScope) to be submited when I
do onclick (where the question marks are).  I don't want to use Javascript,
I want call the action...  I have done this before using <html:submit> but
this is not what I'm trying to achieve here.

I think I might be confused... :-/

regards

Leticia


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



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


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


RE: html:form/Submit question....

Posted by Andrew Hill <an...@gridnode.com>.
<snip>
<a onclick ??? (What goes here) ????
</snip>
JavaScript goes here.

<snip>
I don't want to use Javascript,
</snip>
Um. I think you might be getting a little confused.

<snip>
I think I might be confused... :-/
</snip>
Yes, didnt I just say that?

hehe sorry, couldnt resist ;->

Sounds like what your after is the <input type="image... tag (in struts you
can use <html:image...)
html:
http://webdesign.about.com/library/tags/bltags-inputimage.htm
struts tag:
http://jakarta.apache.org/struts/userGuide/struts-html.html#image

You will still need javascript to do the mouseover effects of course, but it
should degrade ok for users without js (they will still be able to click it
to submit).

hth
Andrew


-----Original Message-----
From: Leticia Golubov [mailto:lgolubov@micromuse.com]
Sent: Monday, 19 January 2004 19:20
To: Struts User Mailing List
Subject: html:form/Submit question....


I have a form and my plan is to set all the fields (using DynaActionForm)
when an ok 'button' is pressed, the problem is, I'm not using a 'submit'
action to submit it, but an image, the code I have at the moment is:

<html:form action="/addNewScope">

..... lots of other code here

<a onclick ??? (What goes here) ????
    onMouseOver="SwapImage('ok','../../images/button_ok_over.png');"
    onMouseDown="SwapImage('ok','../../images/button_ok_click.png');"
    onMouseOut="SwapImage('ok','../../images/button_ok.png');"
    onMouseUp="SwapImage('ok','../../images/button_ok_over.png');">
    <img name="ok" src="../../images/button_ok.png" border="0" width="42"
height="23">
</a>

..... more code here

</html:form>

basically, I want the action in the form (addNewScope) to be submited when I
do onclick (where the question marks are).  I don't want to use Javascript,
I want call the action...  I have done this before using <html:submit> but
this is not what I'm trying to achieve here.

I think I might be confused... :-/

regards

Leticia


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



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