[Proto-Scripty] Singleton Class

2009-01-30 Thread Jim Higson

Might be of interest to the list: I just wrote a blog post about a bit of 
Prototype Singleton code I wrote.

Find it here:
http://jimhigson.blogspot.com/2009/01/prototype-singleton-classes.html

Jim

--~--~-~--~~~---~--~~
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: New use case for Sortable tree?

2009-01-30 Thread ouratel...@googlemail.com

Hi guys i have also been looking into the tree function and its
working great.

I'm interested in seeing Eric's solution as well.

How would i go about limiting the level of nests to a set amount. So
if a item contains items it cannot be drop onto another item as it
would go over the set amount.

Is this even possible?

A real world example would be imagine a cms that has a set pages and
sub pages and a page can only have one level of sub pages.

Cheers



On Jan 27, 9:26 am, Cyrus arianglan...@googlemail.com wrote:
 Hey guys,

 sorry for messing up your thread, but obviously you are using the
 sortable tree: Have you experienced the same problems? (You can answer
 in this 
 thread:http://groups.google.com/group/prototype-scriptaculous/browse_thread/...
 )

 On 26 Jan., 22:12, Stephen sgruenh...@ihouseweb.com wrote:

  Eric,

  I'm interested in seeing your solution. I have the same problem of
  trying to prevent the nested sortables from accepting groups.

  Stephen

  On Jan 7, 3:35 pm, Eric eylin2...@gmail.com wrote:

   I ended up extending Scriptaculous to allow for this behavior.  The
   changes in the new API are:

   1. Added a groupAccept option toSortable.  It takes the same
   argument as Droppables' accept, but is used to limit whatgroupsin 
   aSortabletreewill accept.  (Group is defined as any element in 
   theSortablelist that contains a nested list).  For the example in my
   previous post, I gave all Items a class name like item, and set
   groupAccept to item.  This ensures only Items can be dropped 
   intoGroups,Groupscannot be dropped intoGroups.

   2. To support the implementation of #1, I added an option to
   Droppables called acceptIf.  acceptIf takes a function that takes
   two arguments: the dragged element and the Droppable object.  acceptIf
   should return true if the drop should occur and false otherwise.  This
   is meant to be a more general and dynamic way of specifying what can
   be dropped than the existing accept and containment options.

   If some of you are interested in these enhancements, I can post the
   code here.

   How do I go about adding these enhancements to the Scriptaculous
   trunk?

   Eric

   On Jan 6, 10:31 pm, Eric eylin2...@gmail.com wrote:

I am usingSortablewithtreeenabled on a list like below:

   Group 1
       Item 1
       Item 2
   Item 3
   Group 2
       Item 4

Here, bothGroupsand Items can be dragged.  Additionally, Items can
be dragged intoGroups(each Group contain an UL).  However, I want to
preventGroupsfrom being dragged intoGroups, but there doesn't seem
to be an option inSortableto achieve that.

The solution would be something like being able to specify accept
class names for theSortabletree'snested ULs, so only Items would be
allowed insideGroups.  But that doesn't seem to be possible.  Is
there something that I am missing, or would doing this require me to
extendSortable'simplementation myself?

Thanks,
Eric



By the way, in the course of implementing my drag-and-droptree, I
found thetree-dump output ofSortabletreeto be clumsy to use on the
server side, because it would require me to recreate thetreein the
database each time.  Instead, I added a Draggables observer for the
onEnd event to capture each sorting action, and send to the server
only the change that was made: what element was dragged, which
container it was dragged to and at what position.  This required a bit
of additional coding to determine the location and position of dragged
element, but made the server side code simpler and faster.  I am just
curious, have other people done the same?

--~--~-~--~~~---~--~~
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: trigger a 'change' event for a 'select' element

2009-01-30 Thread david

Hi Anjanesh,

I use a simple bypass to this limitation:
when observing an event, if it's a native event, I create a custom
event native:click that reference the same call back to the original
click observer.
So firing this native:click event, does the job.

--
david

On 29 jan, 16:35, Peter De Berdt peter.de.be...@pandora.be wrote:
 On 29 Jan 2009, at 16:18, Anjanesh wrote:

  I need to trigger a 'change' event for a 'select' element.

  alert($($(elem).parentNode)); // shows [Object HTMLSelectElement]
  $($(elem).parentNode).fire('change'); // How do I indicate which
  option value to change to ?

  But the fire() doesnt work. But no JS errors either.

  Fromhttp://prototypejs.org/api/element/fire:
 Element#fire does not support firing native events. All custom event  
 names must be namespaced (using a colon). This is to avoid custom  
 event names conflicting with non-standard native DOM events such as  
 mousewheel and DOMMouseScroll.

 What you want to to, is set the selectedIndex value from the select  
 element as is documented athttp://www.w3schools.com/htmldom/dom_obj_select.asp
 selectedIndex needs to be an integer. If you want to select it by  
 value, then you'll need to loop the values and when you find the right  
 one, check what index it has (selectedIndex is a getter and a setter)  
 and set it to that index.

 Best regards

 Peter De Berdt
--~--~-~--~~~---~--~~
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: Rerouting Events

2009-01-30 Thread david

Hi solidhex,

I think in this case, you should use the custom event.
Let's try something like that:

$(real_file').observe('launch:file',function(evt){
Event.stop(evt);
alert('real file launching');

});
$('fake_file').observe('click',function(evt){
Event.stop(evt);
$('real_file').fire('launch:file');

});

--
david

On 30 jan, 03:03, Walter Lee Davis wa...@wdstudio.com wrote:
 That's what I meant about it being uneven in browsers. IE will appear  
 to do it, but then the resulting file won't actually upload. Safari  
 works perfectly. I still haven't worked it all out.

 Walter

 On Jan 29, 2009, at 1:12 PM, solidhex wrote:

  Yes, that's actually exactly what I tried. But it didn't seem to do
  anything for me in FF3
--~--~-~--~~~---~--~~
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: trigger a 'change' event for a 'select' element

2009-01-30 Thread Lars Schwarz

what's wrong with a simple (regular, no-need-for-external-libraries)
onChange like:

select id=getmethisselectindex name=getmethisselectindex
onChange=myJsFunc();

and in myJsFunc: var myid = $F('getmethisselectindex');

or did i miss something?

On Fri, Jan 30, 2009 at 11:59 AM, david david.brill...@gmail.com wrote:

 Hi Anjanesh,

 I use a simple bypass to this limitation:
 when observing an event, if it's a native event, I create a custom
 event native:click that reference the same call back to the original
 click observer.
 So firing this native:click event, does the job.

 --
 david

 On 29 jan, 16:35, Peter De Berdt peter.de.be...@pandora.be wrote:
 On 29 Jan 2009, at 16:18, Anjanesh wrote:

  I need to trigger a 'change' event for a 'select' element.

  alert($($(elem).parentNode)); // shows [Object HTMLSelectElement]
  $($(elem).parentNode).fire('change'); // How do I indicate which
  option value to change to ?

  But the fire() doesnt work. But no JS errors either.

  Fromhttp://prototypejs.org/api/element/fire:
 Element#fire does not support firing native events. All custom event
 names must be namespaced (using a colon). This is to avoid custom
 event names conflicting with non-standard native DOM events such as
 mousewheel and DOMMouseScroll.

 What you want to to, is set the selectedIndex value from the select
 element as is documented 
 athttp://www.w3schools.com/htmldom/dom_obj_select.asp
 selectedIndex needs to be an integer. If you want to select it by
 value, then you'll need to loop the values and when you find the right
 one, check what index it has (selectedIndex is a getter and a setter)
 and set it to that index.

 Best regards

 Peter De Berdt
 




-- 
Lars Schwarz
Heiligengeiststr. 26
26121 Oldenburg
T 0441 36110338
M 0151 1727 8127
W www.bitrocker.com

--~--~-~--~~~---~--~~
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: Prevent Ajax.Updater Page Jumps

2009-01-30 Thread david

Hi Mike,

is there a way to test it ? Because I look inside prototype code
(event if i always can miss something) and did not see anything that
could auto positionning after the insert/update is set.

A simple test could be to modify Ajax.Updater to a normal Ajax.Request
and the onComplete callback would update the desired element ??

--
david

On 25 jan, 22:11, Michael J. Sprague mikespra...@gmail.com wrote:
 I've got a page that uses to Ajax.Updater calls to offset the load of
 two content sections that are long running. One section is in the middle
 of the page and one at the bottom.

 I have everything working great except for when the Ajax.Updater calls
 are complete, the page jumps to focus that part of the page. I'd like
 the page to stay unaffected, most of the time the user is still at the
 top. Has anyone else experienced this and have a workaround?

 Thanks ,

 Mike
--~--~-~--~~~---~--~~
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: Prevent Ajax.Updater Page Jumps

2009-01-30 Thread Lars Schwarz

i agree, as long as you don't fire something like focus or scrollto
that page should stay where it is... and of course
you don't have any add-ins installed that auto-focus on input fields
for example :)

On Fri, Jan 30, 2009 at 12:58 PM, david david.brill...@gmail.com wrote:

 Hi Mike,

 is there a way to test it ? Because I look inside prototype code
 (event if i always can miss something) and did not see anything that
 could auto positionning after the insert/update is set.

 A simple test could be to modify Ajax.Updater to a normal Ajax.Request
 and the onComplete callback would update the desired element ??

 --
 david

 On 25 jan, 22:11, Michael J. Sprague mikespra...@gmail.com wrote:
 I've got a page that uses to Ajax.Updater calls to offset the load of
 two content sections that are long running. One section is in the middle
 of the page and one at the bottom.

 I have everything working great except for when the Ajax.Updater calls
 are complete, the page jumps to focus that part of the page. I'd like
 the page to stay unaffected, most of the time the user is still at the
 top. Has anyone else experienced this and have a workaround?

 Thanks ,

 Mike
 




-- 
Lars Schwarz
Heiligengeiststr. 26
26121 Oldenburg
T 0441 36110338
M 0151 1727 8127
W www.bitrocker.com

--~--~-~--~~~---~--~~
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: document.viewport.getScrollOffsets() and document.observe('dom:loaded'...) do not work in IE6?

2009-01-30 Thread david

Hi Adam,

I have tested the dom:loaded alert, and it work fine in IE6.
it seems that the problem is elsewhere.

--
david

On 24 jan, 12:48, silverweb a...@newpoint.pl wrote:
 Hi!

 I'm struggling with some script, and I cannot make
 document.viewport.getScrollOffsets() and document.observe
 ('dom:loaded'...) get to work in IE6 as they do in FireFox...

 My doctype is:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

 document.viewport.getX functions return zero, and when I try to alert
 ('boo!') when DOM is loaded:

 document.observe(dom:loaded, function() {alert('boo!');});

 on IE6 I get nothing! :\

 And I'm on prototype.js 1.6.0.3. On Firefox 3 it is all OK, on IE6 -
 no results... :\

 I even tried other doctypes (as T.J. Crowder suggested 
 inhttp://groups.google.com/group/prototype-scriptaculous/browse_frm/thr...),
 but it didn't help.

 What should I do? :\

 Thanks,
 Adam
--~--~-~--~~~---~--~~
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: trigger a 'change' event for a 'select' element

2009-01-30 Thread david

Hi Lars,

depending on the context, the DOM 0 events is still there and
prototype does not break it so you're totally right to remember
everybody it's still alive!
But some could cry to offense, because of MVC  but stop, it could
launch a discution I did not want.

--
david

On 30 jan, 12:58, Lars Schwarz lars.schw...@gmail.com wrote:
 what's wrong with a simple (regular, no-need-for-external-libraries)
 onChange like:

 select id=getmethisselectindex name=getmethisselectindex
 onChange=myJsFunc();

 and in myJsFunc: var myid = $F('getmethisselectindex');

 or did i miss something?



 On Fri, Jan 30, 2009 at 11:59 AM, david david.brill...@gmail.com wrote:

  Hi Anjanesh,

  I use a simple bypass to this limitation:
  when observing an event, if it's a native event, I create a custom
  event native:click that reference the same call back to the original
  click observer.
  So firing this native:click event, does the job.

  --
  david

  On 29 jan, 16:35, Peter De Berdt peter.de.be...@pandora.be wrote:
  On 29 Jan 2009, at 16:18, Anjanesh wrote:

   I need to trigger a 'change' event for a 'select' element.

   alert($($(elem).parentNode)); // shows [Object HTMLSelectElement]
   $($(elem).parentNode).fire('change'); // How do I indicate which
   option value to change to ?

   But the fire() doesnt work. But no JS errors either.

   Fromhttp://prototypejs.org/api/element/fire:
  Element#fire does not support firing native events. All custom event
  names must be namespaced (using a colon). This is to avoid custom
  event names conflicting with non-standard native DOM events such as
  mousewheel and DOMMouseScroll.

  What you want to to, is set the selectedIndex value from the select
  element as is documented 
  athttp://www.w3schools.com/htmldom/dom_obj_select.asp
  selectedIndex needs to be an integer. If you want to select it by
  value, then you'll need to loop the values and when you find the right
  one, check what index it has (selectedIndex is a getter and a setter)
  and set it to that index.

  Best regards

  Peter De Berdt

 --
 Lars Schwarz
 Heiligengeiststr. 26
 26121 Oldenburg
 T 0441 36110338
 M 0151 1727 8127
 Wwww.bitrocker.com
--~--~-~--~~~---~--~~
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: Setting Response Header Charset to UTF-8 kills functioning in IE and returns ScriptError in Line 1372?

2009-01-30 Thread david

Hi lars,

Look at this thread, it cvould be you're answer!
http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/b5fca1bae6518827?hl=fr

To summarize, it seems that IE does not handle very well UTF-8 XML
content. Is it the same for HTML ??

--
david

On 24 jan, 17:44, lars lars.schw...@gmail.com wrote:
 hey all, i just noticed that setting a charset encoding within the
 response headers makes prototype stop working in IE...

 when i use it like that in my repsonse:

 header(Content-Type: text/html;);

 is works, when is use it like this:

 header(Content-Type: text/html; charset= UTF-8);

 it doesn't return anything in IE and gives my a script error in
 prototype.js line 1372, which is:

 this.responseText = String.interpret(transport.responseText);

 everytingl on the server is set to UTF-8, page encodings, file-
 encodings, responses, charsets and so on.

 any idea why's that?

 thanks: lars
--~--~-~--~~~---~--~~
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: help with autocompleter

2009-01-30 Thread disccomp

 and i need to get this value, like this $searchterm=$_REQUEST['id'];??

You should make it injections safe, for example if using PHP:

$safe_id = mysql_real_escape_string($_REQUEST['id']);
$query = SELECT last_name, first_name FROM people WHERE
last_name='$safe_id' ;

Checkout http://us.php.net/mysql_real_escape_string

--~--~-~--~~~---~--~~
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: help with autocompleter

2009-01-30 Thread Lars Schwarz

if you specified paramName: value on the autocompleter call then on
php side your
variable will be $_POST['value'].

simple pattern search would then work like:

$searchTerm = mysql_real_escape_string($_POST['value']) . %; // add a wildcard

and your query for example might look like select * from foobar where
last_name like '$searchTerm'

when you want to use fulltext search keep in mind there's a
ft_min_word_len config
variable which defaults to 4 characters (so won't get any results when
searching with
2 characters)


On Fri, Jan 30, 2009 at 4:21 PM, disccomp discc...@gmail.com wrote:

 and i need to get this value, like this $searchterm=$_REQUEST['id'];??

 You should make it injections safe, for example if using PHP:

 $safe_id = mysql_real_escape_string($_REQUEST['id']);
 $query = SELECT last_name, first_name FROM people WHERE
 last_name='$safe_id' ;

 Checkout http://us.php.net/mysql_real_escape_string

 




-- 
Lars Schwarz
Heiligengeiststr. 26
26121 Oldenburg
T 0441 36110338
M 0151 1727 8127
W www.bitrocker.com

--~--~-~--~~~---~--~~
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: help with autocompleter

2009-01-30 Thread eulerss

thanks a lot, disccomp and lars, i didnt' know this

$safe_id = mysql_real_escape_string($_REQUEST['id']);

lars you said that

when you want to use fulltext search keep in mind there's a
ft_min_word_len config
variable which defaults to 4 characters (so won't get any results
when
searching with
2 characters)

this variable i think that is defined on prototype.js or
scriptaculous.js?

sorry, but this is my second program using prototype, i'm very new

thanks in advance



De: disccomp discc...@gmail.com
Fecha: Fri, 30 Jan 2009 07:21:41 -0800 (PST)
Local: Vie 30 ene 2009 09:21
Asunto: Re: help with autocompleter
Responder | Responder al autor | Reenviar | Imprimir | Mensaje
individual | Mostrar mensaje original | Informar de este mensaje |
Buscar mensajes de este autor

 and i need

On 30 ene, 09:42, Lars Schwarz lars.schw...@gmail.com wrote:
 if you specified paramName: value on the autocompleter call then on
 php side your
 variable will be $_POST['value'].

 simple pattern search would then work like:

 $searchTerm = mysql_real_escape_string($_POST['value']) . %; // add a 
 wildcard

 and your query for example might look like select * from foobar where
 last_name like '$searchTerm'

 when you want to use fulltext search keep in mind there's a
 ft_min_word_len config
 variable which defaults to 4 characters (so won't get any results when
 searching with
 2 characters)

 On Fri, Jan 30, 2009 at 4:21 PM, disccomp discc...@gmail.com wrote:

  and i need to get this value, like this $searchterm=$_REQUEST['id'];??

  You should make it injections safe, for example if using PHP:

  $safe_id = mysql_real_escape_string($_REQUEST['id']);
  $query = SELECT last_name, first_name FROM people WHERE
  last_name='$safe_id' ;

  Checkouthttp://us.php.net/mysql_real_escape_string

 --
 Lars Schwarz
 Heiligengeiststr. 26
 26121 Oldenburg
 T 0441 36110338
 M 0151 1727 8127
 Wwww.bitrocker.com
--~--~-~--~~~---~--~~
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: help with autocompleter

2009-01-30 Thread Lars Schwarz

ft_min_word_len is a mysql config parameter, no need for it as long you don't
want so use mysql's fulltext search

On Fri, Jan 30, 2009 at 7:12 PM, eulerss eulers...@hotmail.com wrote:

 thanks a lot, disccomp and lars, i didnt' know this

 $safe_id = mysql_real_escape_string($_REQUEST['id']);

 lars you said that

 when you want to use fulltext search keep in mind there's a
 ft_min_word_len config
 variable which defaults to 4 characters (so won't get any results
 when
 searching with
 2 characters)

 this variable i think that is defined on prototype.js or
 scriptaculous.js?

 sorry, but this is my second program using prototype, i'm very new

 thanks in advance



 De: disccomp discc...@gmail.com
 Fecha: Fri, 30 Jan 2009 07:21:41 -0800 (PST)
 Local: Vie 30 ene 2009 09:21
 Asunto: Re: help with autocompleter
 Responder | Responder al autor | Reenviar | Imprimir | Mensaje
 individual | Mostrar mensaje original | Informar de este mensaje |
 Buscar mensajes de este autor

 and i need

 On 30 ene, 09:42, Lars Schwarz lars.schw...@gmail.com wrote:
 if you specified paramName: value on the autocompleter call then on
 php side your
 variable will be $_POST['value'].

 simple pattern search would then work like:

 $searchTerm = mysql_real_escape_string($_POST['value']) . %; // add a 
 wildcard

 and your query for example might look like select * from foobar where
 last_name like '$searchTerm'

 when you want to use fulltext search keep in mind there's a
 ft_min_word_len config
 variable which defaults to 4 characters (so won't get any results when
 searching with
 2 characters)

 On Fri, Jan 30, 2009 at 4:21 PM, disccomp discc...@gmail.com wrote:

  and i need to get this value, like this $searchterm=$_REQUEST['id'];??

  You should make it injections safe, for example if using PHP:

  $safe_id = mysql_real_escape_string($_REQUEST['id']);
  $query = SELECT last_name, first_name FROM people WHERE
  last_name='$safe_id' ;

  Checkouthttp://us.php.net/mysql_real_escape_string

 --
 Lars Schwarz
 Heiligengeiststr. 26
 26121 Oldenburg
 T 0441 36110338
 M 0151 1727 8127
 Wwww.bitrocker.com
 




-- 
Lars Schwarz
Heiligengeiststr. 26
26121 Oldenburg
T 0441 36110338
M 0151 1727 8127
W www.bitrocker.com

--~--~-~--~~~---~--~~
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 1.8.2 not loading library files

2009-01-30 Thread mcrawford

Yeah, I just found the same thing after almost throwing my computer
out of the window after trying to upgrade scripty to 1.8.2. The
update breaks everything if you don't have the scripts in the head.

It's strange that it was changed from 1.8.1 to only look in the head.

On Dec 11 2008, 1:21 am, Alejo alej...@gmail.com wrote:
 Hi George,

 Thank you very much for your answer. Yes, it did help me a bit!
 -
 The problem is that I don'tloadthose libraries directly, but using
 the google.load() functionality. So my question was: where does
 google.load() insert the scripts I call?

 Thanks a lot!

 On 10 dic, 14:53, George george.bea...@googlemail.com wrote:

  Hi There,

  I use the google API loader, just above the closing body tag like
  this:

  scripttype=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/prototype/1.6.0.3/prototype.js/script
  scripttype=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/scriptaculous/1.8.1/scriptaculous.js?
 load=effects,dragdrop,builder/script

  The javascript declarations for theScriptaculousdependent files are
  inserted directly under the original call in 1.8.1.  I also noticed
  that in 1.8.2 it only works if you have the declaration in the page
  head.

  At the moment, I'm sticking with 1.8.1 but to be honest, there's no
  reason why I couldn't move the declarations to the head of the
  document.

  Sorry that's not an answer, but hopefully it helps a bit.

  George

  On Dec 9, 9:06 am, Alejo alej...@gmail.com wrote:

   I'm sorry to re-open this thread, but no-one has told me anything
   about it.

   Does anyone use Google Ajax Loader API with Prototype Scriptaculous?
   Have you got the same problem? How can I solve it?

   Thank you in advance.

   On 1 dic, 17:18, Alejo alej...@gmail.com wrote:

I also have the same problem, but I use Google Ajax API Loader, so I
don't know if the loader puts the javascript files in the head or
somewhere else. How can I solve this problem??

Thank you in advance.

On 1 dic, 09:27, joe.roback joe.rob...@gmail.com wrote:

  So, why can't your scripts be in the head? Do you know you can add
  scripts to the head dynamically? Like this:

 for example, pixelpost photoblog, you want to onlyloadthese in the
 image_template.html, and have a header.html+footer.html defined, the
 scripts will have to go in the body.

 I also found issues with xhtml1.1 and the DOM. Had to use these
 insteaad

 function createElement(element) {
         if (typeof document.createElementNS != 'undefined') {
                 return 
 document.createElementNS('http://www.w3.org/1999/xhtml',
 element);
         }
         else if (typeof document.createElement != 'undefined') {
                 return document.createElement(element);
         }
         return false;

 }

 function setAttribute(element, name, value) {
         if (typeof element.setAttributeNS != 'undefined') {
                 return 
 element.setAttributeNS('http://www.w3.org/1999/xhtml', name,
 value);
         }
         else if (typeof element.setAttribute != 'undefined') {
                 return element.setAttribute(name, value);
         }
         return false;

 }
--~--~-~--~~~---~--~~
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] Django Form

2009-01-30 Thread oboedude

Okay here's the scoop. I am writing a Django form containing text
field inputs and a couple of JavaScript Sliders using the code
provided in script.aculo.us. I was able to staticly define the
JavaScript files from script.aculo.us in Django such that Django sees
the code as a widget and is therefore available for use on forms.

However when I type the appropriate python code into my form model,
the slider does not appear on the completed form. I think the problem
is I am not passing the properties of my slider so that Django knows
what to draw. Does anybody know off the top of their head how to
define these properties so that Django will display the slider?

--~--~-~--~~~---~--~~
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] Hash#filter returns an Array?

2009-01-30 Thread Brad

Why does Hash#filter return an Array instead of a Hash? It isn't
really a filter if it's returning another data type.

Instead of
$H({'a':1,'b':2,'c':3,'d':4}).filter(function(i) { return i.value %
2; })
that returns,
[[a, 1], [c, 3]]
I would expect it to return
{a: 1, c: 3}


--~--~-~--~~~---~--~~
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: Songbird.

2009-01-30 Thread Simon

I get a is not a function message for some - but not all - of the
prorotype commands.

S.


On Jan 30, 2:01 am, kangax kan...@gmail.com wrote:
 On Jan 29, 2:36 am, Simon hs767...@gmail.com wrote:

  Has anyone managed to get prototype running in Songbird yet?

  It is based on a Gecko renderer (like Firefox) but prototype seem not
  to run on it?

 Describe seem not to run on it.

 --
 kangax
--~--~-~--~~~---~--~~
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: Songbird.

2009-01-30 Thread kangax

On Jan 30, 8:21 pm, Simon hs767...@gmail.com wrote:
 I get a is not a function message for some - but not all - of the
 prorotype commands.

A minimal failing test case would help to identify the problem.

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