[Proto-Scripty] Re: Can't seem to get AJAX form validation to work in conjunction with Codeigniter

2010-06-16 Thread jacknife
ops! i have been a little too slow in typing :) On Jun 17, 6:03 am, jacknife wrote: > To continue form submitting you can directly call the submit after the > ajax validation. > a quick example could be: > > [code] > var form = $('form_id'); > > form.observe('submit', function(event){ >        

[Proto-Scripty] Re: Can't seem to get AJAX form validation to work in conjunction with Codeigniter

2010-06-16 Thread jacknife
To continue form submitting you can directly call the submit after the ajax validation. a quick example could be: [code] var form = $('form_id'); form.observe('submit', function(event){ event.stop(); new Ajax.Request(validition_url, { onSuccess : function(response)

[Proto-Scripty] Re: Can't seem to get AJAX form validation to work in conjunction with Codeigniter

2010-06-16 Thread Matt
I just got this working! Here's my final JS code. While the form itself submits to "/search/result/keyword" as the default action, validation is an entirely different "/search/validate/searchkeyword" URL. Event.observe(window, 'load', function() { Event.observe('searchkeyword', 'sub

[Proto-Scripty] Re: Can't seem to get AJAX form validation to work in conjunction with Codeigniter

2010-06-16 Thread Matt
Thanks. This is very helpful. What if I don't want any success text returned? This is for a search engine form. If validation passes (search criteria longer than 2 characters, etc), I just want to submit the full form and not have text returned. Should I somehow be validating against a separat

[Proto-Scripty] detect if window is already loaded

2010-06-16 Thread JoJo
Is it possible to test whether the window has been loaded or not? I have a script.js that anyone can use. Some people will put it in the head tag, so this script will be run before Window has been loaded. Other people might do something crazier like only load script.js when someone clicks a button.

[Proto-Scripty] Re: Can't seem to get AJAX form validation to work in conjunction with Codeigniter

2010-06-16 Thread T.J. Crowder
Hi, You _might_ be able to get it to work with a synchronous ajax call, but I wouldn't recommend it, the user experience would be pretty ugly. (Frozen browser for 2-3 seconds, at least.) I'd probably rejig things a bit so that validation and submission are both done at the same time, via ajax:

[Proto-Scripty] Can't seem to get AJAX form validation to work in conjunction with Codeigniter

2010-06-16 Thread Matt
Is there some kind of trick involved? Here's how I would envision it working: 1) User tries submitting the form 2) Event.observe captures this and sends an AJAX request to a special validation URL (PHP using Codeigniter) 3) If no errors were returned, continue submitting the original form 4) If e

[Proto-Scripty] Re: IE problems: "Stack overflow at line 0"

2010-06-16 Thread Cameron
Actually, I am not using Class.create on B.. sorry if I was misleading by calling it a class. this.options is initially defined inside the B object like so: B = { // default options options: { //... }, initialize: function () { // ... } }; Hope that clears things

[Proto-Scripty] problem with the 'keypress' observe...

2010-06-16 Thread NuDD
Hello all, I have done a small code to change to the next or the previous page on a photo-gallery when the user press on the left or the right arrow. My problem is that work fine on FF and Opera but not on IE and Chrome/ Safary. So I assume than I have done something wrong. My code looks like that