Your link generates an http GET request, and what you want is a POST
request, generated from within a form. The GET request does not send the
data from the form. (thought you could use a <form method="get"
...>)
In the past I have used the link to trigger a JavaScript function to
submit your form. Here''s a nasty snippet. Probably there is something
classier in the prototype library?
Hope it helps! --Allen
<script>
<!--
function submitAction(action) {
var dml=document.Composer;
var len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if (dml.elements[i].name==''a'') {
dml.elements[i].value=action; }
}
document.Composer.submit();
}
// -->
</script>
...
<form name="Composer" id="Composer"
method="post" ...>
<a
href="javascript:submitAction(''h2t'')">link</a>
Saiho Yuen wrote:> Hi,
>
> I have a question about getting the data from a
> textfield. Normally, I put a textfield inside of a
> form, and when a click on the button associated to the
> form, the data written inside the textfield is sent to
> the variable "Params" and I can get it from there.
>
> However, now I have click on a link outside of the
> form which contains the textfield. and the data of the
> textfield is not sent to "params"..so I have not idea
> how to get it.... I''m not really sure, it is a ruby
> question or a normal html question.... Does anyone has
> any idea????
>
> Thanks you very much
>
> sayoyo
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>