You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Edoardo Campagnano <ed...@dappolonia.it> on 2006/11/13 11:37:55 UTC

Ajax form

Sorry for the other mail, this is the complete one

 

Hi,

I'm trying to compute a value at the moment my formi s submitted, in this
way

 

<head>

<script type="text/javascript">

      function getMessage() {

                  document.myForm.myHidden.value="myComputedValue"

      }

      </script>

</head>

<body>

<form jwcid="myForm@tacos:AjaxForm" onSubmit=javascript:getMessage();>

      <span jwcid="myHidden@Hidden" value="ognl:myHiddenField"/>

            <submit jwcid="@tacos:AjaxSubmit"
listener="listener:testMethod"/>

</form>

</body>

 

The idea i sto assign at submit time the value "myComputedValue" to the
hidden field and pass it to the server, but it doesn't work.

 

Any idea?

 

Edoardo Campagnano

 


Re: Ajax form

Posted by Sam Gendler <sg...@ideasculptor.com>.
Here's my response from the other thread:

When I've had this problem in
the past, I have just used my own submit button instead of tapestry
submit component.  Then I just have my submit button call a javascript
method instead of submitting the form.  Then, at the end of the
javascript method, call the appropriate submit method for the form.
This varies depending on if you are in Tap4 + tacos or Tap 4.1.  In
either case, however, it is pretty easy to figure out by just using a
submit component in the page and then taking a look at the javascript
that executes.

I imagine that the sophisticated way to do this would be to use dojo
to inject some before advice into the form submit event.  But to learn
how to do that, you will have to read the dojo book (which actually
has useful material in it these days!) at
http://manual.dojotoolkit.org/WikiHome/DojoDotBook (although the
section that looks most useful to you is here:
http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book10) and/or
consult with someone who has much more knowledge of the tapestry
specific form submission process than I have.

On 11/13/06, Edoardo Campagnano <ed...@dappolonia.it> wrote:
> Sorry for the other mail, this is the complete one
>
>
>
> Hi,
>
> I'm trying to compute a value at the moment my formi s submitted, in this
> way
>
>
>
> <head>
>
> <script type="text/javascript">
>
>       function getMessage() {
>
>                   document.myForm.myHidden.value="myComputedValue"
>
>       }
>
>       </script>
>
> </head>
>
> <body>
>
> <form jwcid="myForm@tacos:AjaxForm" onSubmit=javascript:getMessage();>
>
>       <span jwcid="myHidden@Hidden" value="ognl:myHiddenField"/>
>
>             <submit jwcid="@tacos:AjaxSubmit"
> listener="listener:testMethod"/>
>
> </form>
>
> </body>
>
>
>
> The idea i sto assign at submit time the value "myComputedValue" to the
> hidden field and pass it to the server, but it doesn't work.
>
>
>
> Any idea?
>
>
>
> Edoardo Campagnano
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org