[Proto-Scripty] Re: Scriptaculous problem with option field

2009-01-22 Thread disccomp

Ajax.Request and methods that inherit it(like autocompleter) accept
JSON encoded objects as parameters (AFAIK)

/* Set isMirror to something */
isMirror = myobj.isMirror();

/* OR if this is a server-side determined value echo it */
isMirror = ?php if(something){echo 'true';}else{echo 'false';} ?;

/* Another example, get the value of some text node and pass it as a
param */
myVal = $('textID').value;

myParam:{action:'save',mirror:isMirror, value:myVal} //setup JSON
encoded object

/* ...Include it in your call to the server */
{ parameters: myParam}
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptaculous problem with option field

2009-01-22 Thread disccomp

 myParam:{action:'save',mirror:isMirror, value:myVal} //setup JSON

Sorry, should be: myParam =  NOT myParam:
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptaculous problem with option field

2009-01-22 Thread Walter Lee Davis

You can only get value from a form element, not from a text node. If  
you want to read the raw text out of an HTML element, you'll need to  
use $('textID').innerHTML for that.

Walter

On Jan 22, 2009, at 11:34 AM, disccomp wrote:

 /* Another example, get the value of some text node and pass it as a
 param */
 myVal = $('textID').value;


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptaculous problem with option field

2009-01-21 Thread ColinFine



On Jan 20, 4:33 pm, rolfK r...@ibk-kellner.de wrote:
 Hello,

 Thank you for your fast response. But unfortunately your suggestion
 does not solve the problem. Using xyz as query, the following string
 is transferred:

 Without option field:
 query=xyz
 That is okay and as expected. With your suggestion as option field,
 the following is pushed to the server.
 query=xyz%5Bobject%20Object%5D

There is what looks very much like a bug in the scriptaculous
documentation (as is actually noted at
http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter): the
'parameters' property needs a string, not an object.

Try

new Ajax.Autocompleter(
  query, auto_suggest,
  include/suggest.php,
  { parameters: media_only=media_only  }
);

It would be very much neater if it did accept an object (and I fell
over this myself).

Colin

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptaculous problem with option field

2009-01-20 Thread rolfK

Hello,

Thank you for your fast response. But unfortunately your suggestion
does not solve the problem. Using xyz as query, the following string
is transferred:

Without option field:
query=xyz
That is okay and as expected. With your suggestion as option field,
the following is pushed to the server.
query=xyz%5Bobject%20Object%5D

But the variable 'media_only' is not yet transferred. Changing double
quotes to single quotes has no influence. I've still no idea what to
do. Looking at the API documentation it seems simple. Meanwhile I
tried a lot with brackets and quotes ...

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---