[Proto-Scripty] Re: Finding the first form item of any type within a div
It's a clumsy solution but will save a lot of weird looping but why not give all the form elements a class name and use that in the selector? On Jan 5, 3:17 pm, Tony Andrews tony.andrew...@googlemail.com wrote: I have already posted a question about this on StackOverflow here (http://stackoverflow.com/questions/2006432/finding-the-first- focusable-item-of-any-type-within-a-div) so I won't repeat the whole thing. My issue is that I want to select the first form item of any type (input, select etc.) within a div. When I try $('mydiv').select ('input', 'select') for example, it returns all the inputs, then all the selects. So the first item it returns is not necessarily the first item in document order: if the first item is a select and the scond is an input, it will return the second item first. Any ideas? -- 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-scriptacul...@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: Firefox v3.5
Does it work with the latest stable release? On Jul 29, 8:49 am, evrim erincev...@gmail.com wrote: Nobody has problem like that? Select method in your codes can run well in Firefox 3.5 --~--~-~--~~~---~--~~ 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: select option by value
I'm pretty rubbish at picking other people's code apart but this might work better ... selectID[0].options[i].selected = (selectID[0].options[i].value == valor); break; On Jul 7, 9:58 pm, Martín Marqués martin.marq...@gmail.com wrote: I'm trying to select an option from a select, but by value, and not by index. I'm trying like this: function selectOptionByValue(selectID,valor){ var found = false; var i = 0; while(!found iselectID[0].options.length){ if(selectID[0].options[i].value == valor) { selectID[0].options[i].selected=true; found = true; } i++; } } I would call this function passing as argument the DOM object of the select and the option value that should be selected. Is there an easier way of doing this? BTW, it's not working for me. -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador --~--~-~--~~~---~--~~ 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: Form.request() file upload problem in ie6
You could try YUI uploader if you're prepared to use Flash http://developer.yahoo.com/yui/uploader/ --~--~-~--~~~---~--~~ 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: Opinions appreciated on approach to Getters and Setters.
Thanks for the replies guys. Sometimes JS's flexibility can catch me out. I guess there is no right or wrong way to do anything. Just things to consider. --~--~-~--~~~---~--~~ 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] Array.without() problem
Hey peeps! I'm sure I'm missing something obvious here but I can't for the life of me figure out what's going wrong. I'm trying to use Array.without() to get rid of a number from an array in the fourth line of my code. The trouble is, it returns an array with all instances of the index set to zero. --- this.removeTab = function(index){ list.select(li)[index].remove(); history = history.without(index); if(selected == index){ this.setSelected(history.last()); } } --- Any idea what's going on people? Help much appreciated. BEAR --~--~-~--~~~---~--~~ 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: Dynamic script file loading
I've written some stuff do load dynamic js for my personal library. // hash of namespace names and functions to execute when a namespace has loaded BearLib.loadExecuteQueue = new Hash(); // configuration options BearLib.Config = { // location of bearlib folder libraryPath: [your javascript path] } // load a bearlib namespace // - name: the namespace to load // - onload: function to execute when the namespace has loaded BearLib.load = function(){ // generate the path to the namespace file var src = BearLib.Config.libraryPath + arguments[0] + '.js'; // if the namespace hasn't already been loaded // -- add a generated script element to the head element if($$('script[id=bearlib-' + arguments[0] + ']').length == 0){ $$('head')[0].insert(new Element('script', {'src': src, 'id': 'bearlib-' + arguments[0], 'language': 'javascript', 'type': 'text/ javascript'})); // if the second argument is a function // -- add it to the load execute queue if(typeof(arguments[1]) == 'function'){ BearLib.loadExecuteQueue.set(arguments[0], arguments[1]); }; } } // execute the passed function BearLib.execute = function(){ if(typeof(arguments[0]) == 'function'){ arguments[0](); } } AT THE BOTTOM OF THE SCRIPT FILE BEING LOADED // alert bearlib that the namespace has loaded BearLib.execute(BearLib.loadExecuteQueue.get('theme')); BearLib.loadExecuteQueue.unset('theme'); IN THE PAGE LOADING THE SCRIPT BearLib.load('theme', function(){ alert('Loaded'); }); Hope you find it useful --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---