struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Barrows" <jbarr...@sssc.com>
Subject RE: Re: Why does <html:submit> work differently than <html:link action="">?
Date Wed, 28 Jul 2004 16:58:24 GMT


> -----Original Message-----
> From: Andrew Close [mailto:aclose@gmail.com]
> Sent: Wednesday, July 28, 2004 9:52 AM
> To: Struts Users Mailing List
> Subject: Re: Re: Why does <html:submit> work differently than 
> <html:link
> action="">?
> 
> 
> Jim,
> 
> heh, i would prefer not to use javascript, but i couldn't think of
> another way to submit the form with links.  the form is a <html:form>
> and all of the html components inside the form are Struts html
> components.  the link just has an onclick parameter in it that calls
> the javascript.  the javascript is simply:
> document.form[0].myHiddenField.value = "myValue";
> document.form[0}.submit;
> 
> if found that just using the <html:link forward= /> non of the form
> values were being submitted.  i also tried the <html:link action= />
> and the same occurred.  so i 'assumed' that <html:link> didn't
> actually submit the form but just forwarded to another page or called
> an action.  that's why i deviated to the dark side. :)

Again.. based on the submit working and the javascript not (which is the only way the link
thing will come close to working)  it's a javacript issue.  The submit button and form work
together, the ActionForm is getting populated.  The action is processing the action form.
 The problem is when you use javascript.. then you're probably not using javascript correctly.
 What that has to do with Struts I don't know.

However... this is what I would try... I would take the rendered version of the page... copy
it.. then using your browser submit that... and start tinkering with the javascript from there..
then once you get that working... copy your js to the jsp page.  I really don't think that
this is a problem between struts and js, since when the js runs, the struts tags are completely
out of the picture.


> 
> andy
> 
> On Wed, 28 Jul 2004 09:16:13 -0700, Jim Barrows 
> <jbarrows@sssc.com> wrote:
> 
> > That's not surprising, since that's what the submit button 
> is supposed to do.  You are trying to thing the non-standard 
> and completely screwy way (which imntbho in general of doing 
> ANYTHING in javascript).  I would suggest that you are not 
> calling, or setting up the form correctly in your javascript. 
>  Works with submit, doesn't work with javascript... it's a 
> javascript issue, not a struts issue.
> > I would suggest a javascript form might have more expertise 
> then you might find here, but posting the javascript would be 
> of help for those who do know something about javascript.
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message