struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas.Hartm...@fiducia.de
Subject Re: Submitting forms with javascript in struts [*]
Date Tue, 12 Sep 2006 12:47:29 GMT
On 9/12/06, puneet.lakhina wrote:
>>On 9/12/06, Andreas.Hartmann@fiducia.de <Andreas.Hartmann@fiducia.de> wrote:
>>
>> On 9/12/06, puneet.lakhina wrote:
>>
> >>  On 9/12/06, Andreas.Hartmann@fiducia.de <Andreas.Hartmann@fiducia.de>
wrote:
> >>>
> >>>
> >>> Hello,
> >>>
> >>> I do have a problem, because I don't know how to submit a form with
> >>> javascript
> >>> in struts.
> >>>
> >>> Normally, I'm submitting forms like this:
> >>>
> >>> <html:form action="somepath">
> >>> <html:submit property="myvalue" value="send">
> >>> </html:form>
> >>>
> >>> I'm receiving the value with the getter-method getMyvalue() of the
> >>> appropriate
> >>> ActionForm.
> >>>
> >>>
> >>>
> >>> This time, I want to submit the form with a
> >>>
> >>> <a href=javascript:dosubmit("value")>Some text</a>
> >>
>
>
> I think you should be doing it onclick
> <a href="" onclick='doSubmit("value")'>Some Text</a>

Hmm, doesn't work at all. I can't see any value in getMyvalue().

> And could you please make your mail client use Re for reply to a message
> instead of Antwort. Helps in following the thread.

I have to do all the quoting manually, because I hve to use notes, which isn't
able to quote at all as it is usually done in the internet. I'll do my best :-).

>>
>> > Assuming your property name is myvalue
>> > try this is your java script
>> >
> >> document.formname.myvalue.value= what
> >> document.formname.submit();
>>
>> This doesn't work, too - I'm getting no javascript-error :-(. I don't see
>> any
>> value in getMyvalue().
>>
> >>> dosubmit is a function like
> >>>
> >>> <script>
> >>> dosubmit(what)
> >>> {
> >>>       document.formname.value=what;
> >>>       document.formname.submit();
> >>> }
> >>> </script>
> >>>
> >>>
> >>> The browser submits the form (I'm getting no javascript error), but I
> >>> don't get
> >>> the value of document.formname.value.
> >>>


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


Mime
View raw message