[Proto-Scripty] Re: .select on a combo
hi, have you tried to use the Element class methods readAttribute/ writeAttribute instead that ordinary getAttribute/setAttribute? i recently experienced some issues using getAttribute to retrieve setted parameters. Federico On Sep 18, 7:33 pm, speedpac...@gmail.com speedpac...@gmail.com wrote: Hi Marko, Great idea on combining the different attributes into one value attribute with the pipe character. I'll consider it for a later version, because this obviously also requires changes on the serverside as we'll end up with other values being sent to the server... The class tihngy I knew and was on my todo list to change to that... Unfortunately it doesn't fix my issue at this time (unless I'm misinterpreting what you are saying...) Have you gotten a chance to look into that biyt of code not giving me the result I believed I should have received (and did before I upgraded...) Thanks again for the feedback - I really do appreciate it! David. On Sep 18, 7:01 pm, Marko gm.ma...@gmail.com wrote: Hi, Instead of adding attributes on element you can rewrite it like this: option value=N15 domain=hjkhhjh.ch prepaid_total=18.50 EUR postpaid_total=23.15 EURRegistreer voor 1 Jaar/option = option value=code|domain|pre_total|post_totalRegistreer voor 1 Jaar/option = option value=N15|hjkhhjh.ch|18.50 EUR|23.15 EURRegistreer voor 1 Jaar/option You can get value like this: selectedItem = orderOptions.select('[value=' + orderOptions.getValue() + ']'); = As this is equal to orderOptions you can do: selectedItem = $F(this) Then you can split it and get array: selectedItem.split(|) You can also rewrite your selects like this: Instead of: td f=prepaid write just: td class=prepaid tdPrepaid = rec[0].select('[f=prepaid]'); = tdPrepaid = rec[0].select('.prepaid'); This way you will preserve valid HTML I think you get idea how to rewrite it. - Marko speedpac...@gmail.com wrote: Hello, I'm trying my secod post here - I never got my first to end up on the list, so l'ts try it through the google groups website directly now... I'm having an issue that I hope someone here can help me with... I have the following code: HTML: -- select id=orderOption[hjkhhjh.ch] domain=hjkhhjh.ch name=orderOption[hjkhhjh.ch] option value=N15 domain=hjkhhjh.ch prepaid_total=18.50 EUR postpaid_total=23.15 EURRegistreer voor 1 Jaar/option option value=N16 domain=hjkhhjh.ch prepaid_total=36.30 EUR postpaid_total=45.40 EURRegistreer voor 2 Jaar/option option value=N19 domain=hjkhhjh.ch prepaid_total=53.40 EUR postpaid_total=66.60 EURRegistreer voor 3 Jaar/option option value=N17 domain=hjkhhjh.ch prepaid_total=87.00 EUR postpaid_total=109.00 EURRegistreer voor 5 Jaar/option option value=N18 domain=hjkhhjh.ch prepaid_total=170.50 EUR postpaid_total=213.50 EURRegistreer voor 10 Jaar/option /select What I'm trying to do is when a user selects an option from the list, the prepaid_total and postpaid_total price should show on a different div... this is the javascript that worked up until a few weeks ago when I upgraded to the new release of prototype: JAVASCRIPT: orderOptions.observe('change', function(event) { alert('clicked for ' + orderOptions.getAttribute ('domain')); rec = $('domainSearchResult').select('[domain=' + orderOptions.getAttribute('domain') + ']'); tdPrepaid = rec[0].select('[f=prepaid]'); tdPostpaid = rec[0].select('[f=postpaid]'); alert(orderOptions.getValue()); selectedItem = orderOptions.select('[value=' + orderOptions.getValue() + ']'); alert(selectedItem); tdPrepaid[0].update(selectedItem[0].getAttribute ('prepaid_total')); tdPostpaid[0].update(selectedItem[0].getAttribute ('postpaid_total')); }); The two first alerts give me what I expect, the third one just returns NOTHING... I used to be able to select the options with the value like that, but it seems to be no longer working... Any idea? Also - I know adding attributes to the elements like that is not the way to go - I just don't know how I can do this otherwise :( --~--~-~--~~~---~--~~ 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] Problem with insert ()
Hey there, I've got a wired problem with insert (). Here is a snippet of my code: chkMsg = new Ajax.PeriodicalUpdater ('', '/ajax/chkmgs.php', { method: 'get', frequency: 2, decay: 1.5, onSuccess: function test (originalRequest) { var reg = /id=newMessage(\d+)/; var result; var currentmessageids = new Array (); var newmessages = Array (); while (result = reg.exec($('messages').innerHTML)){ currentmessageids.push (result[1]); } newmessages = originalRequest.responseText.split (---NEW---); newmessages.each ( function (value) { result = reg.exec (value); if (!currentmessageids.in_array (result[1])) { // MY PROBLEM ON THE SECOND RUN // $('messages').insert (value); } }) }, }); the first time this runs (onload) everything's fine. But when the second update happens, the script stops. Firefox prompt 'Script is not responding' Safari crashes. When I replace the insert with an update () the same. With an alert () it works. I have no idea what the problem is. Maybe someone can help me out on this? I assume it's my fault and already tried to search for a solution, maybe got the wrong search parameters, didn't find anything helpfull. So any help is very welcome... thanks olly --~--~-~--~~~---~--~~ 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: Masked Input in Prototype
On Jul 29, 11:27 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: why not just port the jquery one... wont take long ! Sorry for resurrecting this topic after two months. In case anyone comes to this thread looking for masked input for prototype (I know I did :-). I thought I'd mention that I've ported the jQuery version to prototype. You can get the code here: http://bjartekv.github.com/MaskedInput/ Regards, Bjarte --~--~-~--~~~---~--~~ 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: Problem with insert ()
Hi, Your regexp doesn't have the 'g' flag, so I suspect this is an endless loop: while (result = reg.exec($('messages').innerHTML)){ currentmessageids.push (result[1]); } Adding the 'g' flag should fix it.[1] Somewhat OT, but I would recommend grabbing innerHTML to a local var and then reusing it, it's inefficient to go off and look up the element and then retrieve its innerHTML on every loop. [1] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/exec HTH, -- T.J. Crowder tj / crowder software / com www / crowder software / com On Sep 19, 11:37 pm, ohnesorge ohneso...@design-xpress.de wrote: Hey there, I've got a wired problem with insert (). Here is a snippet of my code: chkMsg = new Ajax.PeriodicalUpdater ('', '/ajax/chkmgs.php', { method: 'get', frequency: 2, decay: 1.5, onSuccess: function test (originalRequest) { var reg = /id=newMessage(\d+)/; var result; var currentmessageids = new Array (); var newmessages = Array (); while (result = reg.exec($('messages').innerHTML)){ currentmessageids.push (result[1]); } newmessages = originalRequest.responseText.split (---NEW---); newmessages.each ( function (value) { result = reg.exec (value); if (!currentmessageids.in_array (result[1])) { // MY PROBLEM ON THE SECOND RUN // $('messages').insert (value); } }) }, }); the first time this runs (onload) everything's fine. But when the second update happens, the script stops. Firefox prompt 'Script is not responding' Safari crashes. When I replace the insert with an update () the same. With an alert () it works. I have no idea what the problem is. Maybe someone can help me out on this? I assume it's my fault and already tried to search for a solution, maybe got the wrong search parameters, didn't find anything helpfull. So any help is very welcome... thanks olly --~--~-~--~~~---~--~~ 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] walking the DOM
I have little experience manipulating the dom other than using $( to get/set style elements so direct advice and a link for education would be appreciated. Overall, the problem I have is a bunch of stacked divs with different z-indexes. Sometimes the user will want to move a dive to the front. This is not a problem, but I worry that with the page open for 6 - hours (all functions are performed with AJAX) my z-index number will grow too large. So, what I would like to do is decrement the z-index of all the divs involved when incrementing the one I am bringing to the front. I don't want to decrement the z-index of all the divs. I don't want to decrement the ones that are currently display=none nor the ones that stay visible all the time, nor divs that are children of the stacked divs. The stacked divs are all children of body, but so are some that should not be affected. If it would make the job easier, I could move all the stacked divs into a container div. So, how to walk though all the stacked divs to change their z-index, if currently being displayed ? If prototype does not offer assistance (but I can't imagine that), let me know and I will post in a .js group. -- Bill Drescher william {at} TechServSys {dot} 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: walking the DOM
Hi Bill, If you make them all children of one container, then you can process them in a loop like so: var divsToSuppress, n; divsToSuppress = $('containerName').children(); for (n = divsToSuppress.length - 1; n = 0; --n) { divsToSuppress[n].setStyle({'zIndex': '4'}); // = Or whatever value } Alternately, if you give all of these stackable divs some class name, you can use divsToSuppress = $$('div.xyz'); ...at the beginning of that. FWIW, -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com On Sep 20, 12:01 pm, bill will...@techservsys.com wrote: I have little experience manipulating the dom other than using $( to get/set style elements so direct advice and a link for education would be appreciated. Overall, the problem I have is a bunch of stacked divs with different z-indexes. Sometimes the user will want to move a dive to the front. This is not a problem, but I worry that with the page open for 6 - hours (all functions are performed with AJAX) my z-index number will grow too large. So, what I would like to do is decrement the z-index of all the divs involved when incrementing the one I am bringing to the front. I don't want to decrement the z-index of all the divs. I don't want to decrement the ones that are currently display=none nor the ones that stay visible all the time, nor divs that are children of the stacked divs. The stacked divs are all children of body, but so are some that should not be affected. If it would make the job easier, I could move all the stacked divs into a container div. So, how to walk though all the stacked divs to change their z-index, if currently being displayed ? If prototype does not offer assistance (but I can't imagine that), let me know and I will post in a .js group. -- Bill Drescher william {at} TechServSys {dot} 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: A better way to check for an element.
Mislav's when() seems a bit redundant when called inside of document.observe('dom:loaded')... I think this topic would be interesting to discuss in the the proto-dev mailing list, ie. exceptions thrown for non-existant elements... i'd also like to see some kind of support for catching stupid coding: documents with elements that have the same id (like... div id=myDiv/div div id=myDiv/div...ugh.) I wrote a snippet that used mutation events to check the document for junk like this, but sadly, DOMContentLoaded, DOMNodeInsterted et al aren't supported widely enough to warrant production level usage. Rick On Sat, Sep 19, 2009 at 8:39 AM, Radoslav Stankov rstan...@gmail.comwrote: You can use something like my CD3.Behavior lib ( http://github.com/RStankov/controldepo-3-widgets/blob/master/src/behaviors.js ) code CD3.Behaviors({'#element:click': yourClickHandler }); // -- or -- CD3.Behaviors('#element', function(){ this.observe('click', yourClickHandler); }); // -- or ... CD3.Behaviors have really large set of possible uses /code Or ... use Mislav's when() function http://mislav.uniqpath.com/js/when-available-in-prototype/ --~--~-~--~~~---~--~~ 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: A better way to check for an element.
Thats not to say that when() isn't pretty cool :) On Sun, Sep 20, 2009 at 9:00 AM, Rick Waldron waldron.r...@gmail.comwrote: Mislav's when() seems a bit redundant when called inside of document.observe('dom:loaded')... I think this topic would be interesting to discuss in the the proto-dev mailing list, ie. exceptions thrown for non-existant elements... i'd also like to see some kind of support for catching stupid coding: documents with elements that have the same id (like... div id=myDiv/div div id=myDiv/div...ugh.) I wrote a snippet that used mutation events to check the document for junk like this, but sadly, DOMContentLoaded, DOMNodeInsterted et al aren't supported widely enough to warrant production level usage. Rick On Sat, Sep 19, 2009 at 8:39 AM, Radoslav Stankov rstan...@gmail.comwrote: You can use something like my CD3.Behavior lib ( http://github.com/RStankov/controldepo-3-widgets/blob/master/src/behaviors.js ) code CD3.Behaviors({'#element:click': yourClickHandler }); // -- or -- CD3.Behaviors('#element', function(){ this.observe('click', yourClickHandler); }); // -- or ... CD3.Behaviors have really large set of possible uses /code Or ... use Mislav's when() function http://mislav.uniqpath.com/js/when-available-in-prototype/ --~--~-~--~~~---~--~~ 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: including prototype dynamically, and observe:domloaded
If none of the above work... document.write('script type=text/javascript src=' http://somewhere/edu/is//prototype.js;\/script'); have you tried removing the extra / before prototype.js? On Fri, Sep 18, 2009 at 1:45 PM, Ngan Pham nganp...@gmail.com wrote: Hi jrochkind, I believe document.write is execute properly and full before your observe call is done. However, document.write's job is simply to write the string to the browser, nothing more. It's then the browser's job to interpret the string and do whatever it has to do on a different tangent. In this case, load an external javascript document. So immediately after document.write has performed it's job, the next statement is ran--which causes the problem for you since the external prototype script is not ready. As stated above this isn't a good thing to do in general. However, to answer your questionyou either of the follow (there may be more options): 1. Modify the prototype.js file and add a function call at the bottom to let your page know prototype is loaded. 2. Use a setInterval function to periodically check for prototype's existence. Once it's available you can then stop the checking and resume your code. On Thu, Sep 17, 2009 at 12:37 PM, Jonathan Rochkind rochk...@jhu.eduwrote: Thanks Alex, I think that post does have the right analysis of what was going on in my case and why it wasn't working. And thanks for the alert that loading prototype via document.write in general may be a bad idea. Is there any good way to have an external .js file trigger a load of Prototype, or is this basically just a lost cause, and if you want Prototype on a page, you've just got to include a script tag that references a prototype.js file directly on the page, no ifs and or buts? Jonathan On Sep 17, 3:23 pm, Alexander Wallace alexmlwall...@gmail.com wrote: While I don't recommend loading prototype via document.write, this might be due to including both the doc.write(prototype) and the doc.observe() function within the same enclosing script tag. See: http://kossovsky.net/index.php/2009/07/script-as-blocking-element-and... But I really don't recommend loading prototype.js using document.write. I'm not sure how that would interfere with the IE method of dom:loaded (which involves using document.writing a deferred script element and watching its .onreadystatechange), but I can't imagine the outcome would be bug-free. -Alex On Thu, Sep 17, 2009 at 2:54 PM, jrochkind rochk...@jhu.edu wrote: So theoretically (Prototype 1.6), it should be possible to have javascript code include the Prototype library into a page via document.write, right? document.write('script type=text/javascript src=' http://somewhere/ edu/is//prototype.js\/script'); Okay, this mostly works. Unless you want the same script that did this to then immediately call any Prototype function, such as document.observe. document.write('script type=text/javascript src=' http://somewhere/ edu/is//prototype.js\/script'); document.observe(dom:loaded, function() { alert('loaded!'); }); This does NOT work, because at the point that document.observe is up there, Prototype is NOT actually loaded yet. Although it will be eventually. Can anyone explain what's going on? Does the browser not do or fully process the document.write until after the current script is fully done? Is there any way to have a script include the prototype library dynamically, and then have that same script call some prototype functions, such as in particular document.observe? --~--~-~--~~~---~--~~ 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: walking the DOM
T.J. Crowder wrote: Hi Bill, If you make them all children of one container, then you can process them in a loop like so: var divsToSuppress, n; divsToSuppress = $('containerName').children(); for (n = divsToSuppress.length - 1; n = 0; --n) { divsToSuppress[n].setStyle({'zIndex': '4'}); // = Or whatever value } Alternately, if you give all of these stackable divs some class name, you can use divsToSuppress = $$('div.xyz'); ...at the beginning of that. Where xyz is the class name ? bill FWIW, -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com On Sep 20, 12:01 pm, bill will...@techservsys.com wrote: I have little experience manipulating the dom other than using $( to get/set style elements so direct advice and a link for education would be appreciated. Overall, the problem I have is a bunch of stacked divs with different z-indexes. Sometimes the user will want to move a dive to the front. This is not a problem, but I worry that with the page open for 6 - hours (all functions are performed with AJAX) my z-index number will grow too large. So, what I would like to do is decrement the z-index of all the divs involved when incrementing the one I am bringing to the front. I don't want to decrement the z-index of all the divs. I don't want to decrement the ones that are currently display=none nor the ones that stay visible all the time, nor divs that are children of the stacked divs. The stacked divs are all children of body, but so are some that should not be affected. If it would make the job easier, I could move all the stacked divs into a container div. So, how to walk though all the stacked divs to change their z-index, if currently being displayed ? If prototype does not offer assistance (but I can't imagine that), let me know and I will post in a .js group. -- Bill Drescher william {at} TechServSys {dot} com -- Bill Drescher william {at} TechServSys {dot} 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: walking the DOM
Where xyz is the class name ? Yup. -- T.J. :-) On Sep 20, 2:47 pm, bill will...@techservsys.com wrote: T.J. Crowder wrote: Hi Bill, If you make them all children of one container, then you can process them in a loop like so: var divsToSuppress, n; divsToSuppress = $('containerName').children(); for (n = divsToSuppress.length - 1; n = 0; --n) { divsToSuppress[n].setStyle({'zIndex': '4'}); // = Or whatever value } Alternately, if you give all of these stackable divs some class name, you can use divsToSuppress = $$('div.xyz'); ...at the beginning of that. Where xyz is the class name ? bill FWIW, -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com On Sep 20, 12:01 pm, bill will...@techservsys.com wrote: I have little experience manipulating the dom other than using $( to get/set style elements so direct advice and a link for education would be appreciated. Overall, the problem I have is a bunch of stacked divs with different z-indexes. Sometimes the user will want to move a dive to the front. This is not a problem, but I worry that with the page open for 6 - hours (all functions are performed with AJAX) my z-index number will grow too large. So, what I would like to do is decrement the z-index of all the divs involved when incrementing the one I am bringing to the front. I don't want to decrement the z-index of all the divs. I don't want to decrement the ones that are currently display=none nor the ones that stay visible all the time, nor divs that are children of the stacked divs. The stacked divs are all children of body, but so are some that should not be affected. If it would make the job easier, I could move all the stacked divs into a container div. So, how to walk though all the stacked divs to change their z-index, if currently being displayed ? If prototype does not offer assistance (but I can't imagine that), let me know and I will post in a .js group. -- Bill Drescher william {at} TechServSys {dot} com -- Bill Drescher william {at} TechServSys {dot} 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: walking the DOM
T.J. Crowder wrote: Where xyz is the class name ? Yup. Thanks -- Bill Drescher william {at} TechServSys {dot} 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] newbie - form submit
Hello all, I'd love to create a contact form using prototype and php. However, I want to make sure that, if the javascript is disable, the submission should be server side validated and submitted as well. If javascript is enable, the onclick event will trigger, hence, the js validation Will occur. If the javascript isn't enable, the onclick event will not trigger, so the submit button will get called, and the server side validation will occur. I don't know if it's precise, however, it works. Now what I'd like to do is, without leaving the same page, when the form is submitted, the div that contains the form gets hidden, and it should be replaced by a div telling: The contact was send. I'm so newbie, that I've found a validation class called: Really easy field validation with Prototype and it seems to be very nice. Can anyone summarize the steps to accomplish this without losing the server side submission if, js Is disable somehow? Should I try to edit (I really don't like this idea) the validation class for doing this? Or can this be done otherwise? Thanks a lot to any feedback on this, Regards, MEM --~--~-~--~~~---~--~~ 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: newbie - form submit
Never rely on client side validation, that's for convenience for your users, not security.First, make the functionality works (including security) without javascript. Then override the submit button with javascript by observing the submit. In that event code you submit the form via ajax, hide the div, display what you want, etc. then use event.stop to keep the default submit behavior from occurring. Good luck with this. Some links: http://api.prototypejs.org/dom/event.html#stop-class_method http://api.prototypejs.org/dom/event.html#stop-class_method http://api.prototypejs.org/dom/document.html#observe-class_method http://api.prototypejs.org/dom/element.html#update-class_methodand http://api.prototypejs.org/ajax/ajax/updater.html On Sun, Sep 20, 2009 at 9:47 AM, MEM tal...@gmail.com wrote: Hello all, I'd love to create a contact form using prototype and php. However, I want to make sure that, if the javascript is disable, the submission should be server side validated and submitted as well. If javascript is enable, the onclick event will trigger, hence, the js validation Will occur. If the javascript isn't enable, the onclick event will not trigger, so the submit button will get called, and the server side validation will occur. I don't know if it's precise, however, it works. Now what I'd like to do is, without leaving the same page, when the form is submitted, the div that contains the form gets hidden, and it should be replaced by a div telling: The contact was send. I'm so newbie, that I've found a validation class called: Really easy field validation with Prototype and it seems to be very nice. Can anyone summarize the steps to accomplish this without losing the server side submission if, js Is disable somehow? Should I try to edit (I really don't like this idea) the validation class for doing this? Or can this be done otherwise? Thanks a lot to any feedback on this, Regards, MEM --~--~-~--~~~---~--~~ 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] Prototype Selector Speed
Hello, I have been using prototype for a few months now, and so far I have enjoyed the functionality that it brings. However, I have noticed that it's speed is lacking. This makes me tentative to use prototype for a rather large project that I have been planning. To confirm this, I ran the tests from http://mootools.net/slickspeed/ by checking out the project from SVN, and used the latest versions of all of the frameworks listed. Prototype and mootools consistently finished at the bottom, which concerns me a little. After looking at the results I have been seriously considering switching to JQuery, although I am disappointed at their lack of OOP support. Is there any plans in the future to improve on prototype's speed? Also has there been a tentative release date set for scripty2? I'm reluctant to develop anything that heavily uses scriptaculous, since it appears scripty2 is in alpha state, although it has been that way since June. Thanks, -Andy --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---