You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Robert Miller <rm...@ofumic.com> on 2004/07/28 18:18:08 UTC

Re: Re: Why does work differently than ?

Andy,
I don't have an answer but what I would try first is examining those
values on the client.
First do a view source on your generated HTML and make sure your values
are there.
Next in your Javascript after you've set any values but before you
submit your form (which should be last anyway) use an "alert" command
(Example: alert("my value = " + form.field.value); ).
Hope this helps.
Robert

>>> aclose@gmail.com 7/28/2004 11:09:37 AM >>>

hi Robert,

yes i've tried using javascript, but i must be doing something wrong. 
i've tried two approaches.  1) i was calling a javascript function
that set the action for me and then submited the form.  but the values
inside my hidden fields weren't getting picked up.  2) Wendy gave me a
slightly different approach to try by calling the function and setting
the values of the hidden fields and then submitting.  however, two of
the hidden fields are set upon arrival to the page by my action form. 
but they are not being picked up when i leave.
all of this works flawlessly when using a submit button. :)  

andy

On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller <rm...@ofumic.com>
wrote:
> Andy,
> Sorry, I haven't been following your situation closely.
> Have you looked into using Javascript to have the link trigger form
> submission?
> 
> An example of what I am talking about can be found here:
>
http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
> 
> Robert
> 
> >>> aclose@gmail.com 7/28/2004 10:20:01 AM >>>
> 
> 
> 
> hi all,
> 
> i'm still struggling with form submission.  i would prefer to use
> links on the page to submit my form instead of a 'submit button'. 
but
> i'm unable to get the correct functionality to work.  when
submitting
> with the submit button all my hidden fields are slurped up and
> populated on the next page correctly.  however, when using
<html:link>
> i'm only able to get one of the values from my hidden fields slurped
> up.  the others remain blank...
> using the debugger in my action form i only see one of the three set
> methods getting called even though all three hidden fields are
inside
> the form and are populated.  i am using the <html:hidden> field. ;)
> any thoughts?  i'm sure there are others that use links on forms
> instead of buttons.  what are you doing?
> 
> thanks
> andy
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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



Re: Re: Why does work differently than ?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Andrew, could you restate what you are trying to do?  Why are you using 
JavaScript?  My guess is there is a safer and sounder way to solve whatever 
your problem is, if you merely are trying to submit a form with some issues 
which are unknown to me around that.

Michael



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


Re: Re: Re: Why does work differently than ?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 09:41 AM 7/28/2004, you wrote:
>Robert,
>
>:i'm seeing the data,
>but when i set breakpoints in my actionform set methods, two of them
>aren't being called...
>
>andy

The question, Andy, whatever your problem is, that Robert is posing is 
whether "form.field.value" shows the data.  Whether you are just seeing the 
data is not relevant.  I am getting bugged trying to figure out what in the 
hay your problem could be to require this kind of a solution.

Michael 



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


Re: Re: Re: Why does work differently than ?

Posted by Andrew Close <ac...@gmail.com>.
Robert,

:)  i'm a step ahead of you.  my values do show up in the client side
html before submitting the form.  and they show up in alert statements
upon submission.  that is what is so puzzling.  i'm seeing the data,
but when i set breakpoints in my actionform set methods, two of them
aren't being called...

andy

On Wed, 28 Jul 2004 11:18:08 -0500, Robert Miller <rm...@ofumic.com> wrote:
> Andy,
> I don't have an answer but what I would try first is examining those
> values on the client.
> First do a view source on your generated HTML and make sure your values
> are there.
> Next in your Javascript after you've set any values but before you
> submit your form (which should be last anyway) use an "alert" command
> (Example: alert("my value = " + form.field.value); ).
> Hope this helps.
> Robert
> 
> >>> aclose@gmail.com 7/28/2004 11:09:37 AM >>>
> 
> 
> 
> hi Robert,
> 
> yes i've tried using javascript, but i must be doing something wrong.
> i've tried two approaches.  1) i was calling a javascript function
> that set the action for me and then submited the form.  but the values
> inside my hidden fields weren't getting picked up.  2) Wendy gave me a
> slightly different approach to try by calling the function and setting
> the values of the hidden fields and then submitting.  however, two of
> the hidden fields are set upon arrival to the page by my action form.
> but they are not being picked up when i leave.
> all of this works flawlessly when using a submit button. :)
> 
> andy
> 
> On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller <rm...@ofumic.com>
> wrote:
> > Andy,
> > Sorry, I haven't been following your situation closely.
> > Have you looked into using Javascript to have the link trigger form
> > submission?
> >
> > An example of what I am talking about can be found here:
> >
> http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
> >
> > Robert
> >
> > >>> aclose@gmail.com 7/28/2004 10:20:01 AM >>>
> >
> >
> >
> > hi all,
> >
> > i'm still struggling with form submission.  i would prefer to use
> > links on the page to submit my form instead of a 'submit button'.
> but
> > i'm unable to get the correct functionality to work.  when
> submitting
> > with the submit button all my hidden fields are slurped up and
> > populated on the next page correctly.  however, when using
> <html:link>
> > i'm only able to get one of the values from my hidden fields slurped
> > up.  the others remain blank...
> > using the debugger in my action form i only see one of the three set
> > methods getting called even though all three hidden fields are
> inside
> > the form and are populated.  i am using the <html:hidden> field. ;)
> > any thoughts?  i'm sure there are others that use links on forms
> > instead of buttons.  what are you doing?
> >
> > thanks
> > andy
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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