Getting value from form?

Hello,

I have a form which contains a text_area. I would like to be able to
access the text in the text_area without submitting the form, is this
possible?

More details… The text area is a ‘user file’ and when the form is
submitted, the users changes in the text_area are saved. I use
:onkeypressed => remote_function to make a call to update the view (i
want to edit the file name on the web page, to *file name, so the user
knows they have to save changes).

  • Firstly - is there anyway to just execute the call once - as thats
    all i need…
  • Secondly - is there anyway to pass the edited content of the text_area
    as a string in the remote call to the controller… - so i can save this
    seperately??

Any light that you can shed on either firstly or secondly would be very
much appreciated…

Jamie

Hi James,

James S. wrote:

I have a form which contains a text_area.
I would like to be able to access the text
in the text_area without submitting the form

when the form is submitted, the users changes
in the text_area are saved.

I’m confused by these two statements. What exactly do you mean by
‘without
submitting’? Why don’t you want to submit the form? It will probably
help
if you can describe what you’re trying to accomplish in terms of 1) what
happens on the server, and 2) what the visitor sees in their browser.

Best regards,
Bill

OK, sorry for the vague description before…

I have a remote form which i submit using ‘onsubmit()’ from two
different links in my view. I understand that html limits us to only
executing a single action when a form is submitted - however i would
like to distinguish between which of the links the form has been
submitted from…

This is an example of one of the two links that submit my form:

<= link_to_remote ‘link’, :before => “javascript:myform.onsubmit()” %>

Is there a way to pass the form a parameter using this javascript call
to submit the form?

Hope this is clearer…

Jamie