On Jul 3, 2011, at 11:00 AM, Walter Lee Davis wrote:


On Jul 3, 2011, at 6:39 AM, bill wrote:

On 7/2/2011 6:29 PM, Walter Lee Davis wrote:


On Jul 2, 2011, at 6:09 PM, Phil Petree wrote:

When making the following ajax call:
new Ajax.Updater( 'result', url, {method: 'post', parameters: $ ('myform').serialize(), onSuccess: fill_in, onFailure: ajax_err, on0: ajax_err}); I was wondering why my listbox contents were not showing up on the server... stepping through the Ajax.Updater call in prototype I found parameters was set/serialized as follows:

parameters "status = insert &record = &userid = 2 &police =0&injury=0&damage=0&occured=07%2F02%2F2011&message_text=woo %20hoo&countdown=1017&lat=&lon=&fixed=2020%20NE%2056th%20St.%2C %20Ft.%20Lauderdale%2C%20FL%2033308" String

At the end, where "String" is dangling like a participle, should be the name of a listbox and the single option in the listbox.

Would someone kindly tell me what I have to do to get a listbox to serialize?

Thanks!

It should just do. Can you please post the complete HTML for that select? My guess is that the HTML isn't valid somehow, but String is a mighty funny output for the getValue() function.

Walter

I do believe that checkboxes only show up when they are checked.

True, but this is a select.

<select size="1" id="foo">
<option label="Bar" value="bar">Bar</option>
<option label="Baz" value="baz">Baz</option>
<option label="Boo" value="boo">Boo</option>
</select>

$('foo').getValue(); //=> 'bar' (or whatever other option was chosen)

form.serialize uses Element.getValue(), which knows all about select elements. But if $('foo') didn't actually resolve to this particular select (say, if there was another element on the same page with that ID) then you would have a problem.

Where by Element.getValue() I really mean Form.Element.getValue(), actually. Too early, not enough coffee...

Walter

--
You received this message because you are subscribed to the Google Groups "Prototype 
& script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to