Google Groups Home
Help | Sign in
Send form
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Deva Satyam  
View profile
 More options May 12, 2:38 pm
From: Deva Satyam <DevaSat...@gmail.com>
Date: Mon, 12 May 2008 11:38:40 -0700 (PDT)
Local: Mon, May 12 2008 2:38 pm
Subject: Send form
I was looking at the code for the Form and I think it could be handy
if instead of assembling the message as a JSON string and send it as a
post, you could use method setForm of Connection Manager (http://
developer.yahoo.com/yui/connection/#forms).  Eventually, this would
allow to upload files, which you can't otherwise.

All server scripting libraries have support for URL-encoded arguments
and doing it using JSON adds a needless complexity.  Even if you do it
by code as you currently do, it is better is you use URL-encoding, it
was server scripting languages would naturally expect.  It is what you
have to do first anyhow to get the JSON data to then decode.  Two
decoding steps.

If the value to be sent is different from the value as seen in the
input control the user sees, you could set a separate hidden input
field with the converted value.  setForm won't send any input controls
without a name attribute so by not putting a name on it, you can
exclude a field from being sent.

Anyway, the way it is done, if you place an = or a &, it will break
the JSON message.  You have to use JavaScript methods escape or
encodeURIComponent on that JSON string before placing it on the URL.

Also, your code is not adding the name=value of the submit button
itself.  There might be forms with different actions represented by
different submit buttons and you have to know which one was clicked.
Besides, that is the expected behavior.

The Form object should also have a renderHidden just as it has a
renderButtons so that you can specify extra hidden fields to be sent
along the form.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google