[jQuery] Re: validation plugin addMethod does not work for me.
Still no go... below is my code. I just want to pop a dialog to ask the user if they are sure they want to leave the company name blank. The field is not required. I thought it would be easier than this? I can't get teh addMethod to work or fire at all on validation. //validates the form var validator = frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) {error.prependTo ( element.parents(div.ctrlHolder));}, errorElement:'div', errorClass:'valerror', rules: { restitutionaddress: {required: #sameAsBusinessAddress [checked='false']}, restitutioncity: {required: #sameAsBusinessAddress [checked='false']}, restitutionstate: {required: #sameAsBusinessAddress [checked='false']}, restitutionzipcode: {required: #sameAsBusinessAddress [checked='false']}, company:true } }); $.validator.addMethod( company, function(value, element) {alert (hello); return false;}, Enter a Company Name ); On Oct 21, 9:18 pm, Leonardo K leo...@gmail.com wrote: U need set the rules for your validation: frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) { error.prependTo( element.parents(div.ctrlHolder)); }, errorElement:'div', errorClass:'valerror', rules:{ nameField:{ company:true } } }); On Wed, Oct 21, 2009 at 22:04, JMan jbeck...@gmail.com wrote: what am I doing wrong here? I cannot figure out how to use the addMethod(). var frmSubmittal = $(#frmSubmittal); //validates the form frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) {error.prependTo ( element.parents(div.ctrlHolder));}, errorElement:'div', errorClass:'valerror' }); $.validator.addMethod( company, function(value, element) {alert (hello); return false;}, Enter a Company Name );
[jQuery] Re: validation plugin addMethod does not work for me.
Thanks Leonardo... I figured it out after digging through several examples. The documentation for this plugin has a huge gap in it. It shows an example of how to define a custom validator but no where does it explain how to use it. The trick being as you mentioned, defining it in the Rules or you can put the name of your custom validator in the class attribute of the field it applies to. The sad part is after hours of struggling with this it does not work as I had hoped it would. I am prompting the user for input and based on their response I would like to either cancel the form submit or allow it to continue. On Oct 22, 11:48 am, Leonardo K leo...@gmail.com wrote: One thing is your method name and other is your field name. If the name of your field is company and your method is company so: rules:{ company:{ company:true } } Maybe is better rename your method to not confuse. On Thu, Oct 22, 2009 at 13:24, JMan jbeck...@gmail.com wrote: Still no go... below is my code. I just want to pop a dialog to ask the user if they are sure they want to leave the company name blank. The field is not required. I thought it would be easier than this? I can't get teh addMethod to work or fire at all on validation. //validates the form var validator = frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) {error.prependTo ( element.parents(div.ctrlHolder));}, errorElement:'div', errorClass:'valerror', rules: { restitutionaddress: {required: #sameAsBusinessAddress [checked='false']}, restitutioncity: {required: #sameAsBusinessAddress [checked='false']}, restitutionstate: {required: #sameAsBusinessAddress [checked='false']}, restitutionzipcode: {required: #sameAsBusinessAddress [checked='false']}, company:true } }); $.validator.addMethod( company, function(value, element) {alert (hello); return false;}, Enter a Company Name ); On Oct 21, 9:18 pm, Leonardo K leo...@gmail.com wrote: U need set the rules for your validation: frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) { error.prependTo( element.parents(div.ctrlHolder)); }, errorElement:'div', errorClass:'valerror', rules:{ nameField:{ company:true } } }); On Wed, Oct 21, 2009 at 22:04, JMan jbeck...@gmail.com wrote: what am I doing wrong here? I cannot figure out how to use the addMethod(). var frmSubmittal = $(#frmSubmittal); //validates the form frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) {error.prependTo ( element.parents(div.ctrlHolder));}, errorElement:'div', errorClass:'valerror' }); $.validator.addMethod( company, function(value, element) {alert (hello); return false;}, Enter a Company Name );
[jQuery] jquery.com plugin directory
Is it just me or does anyone else have the hardest time finding plugins on the jquery.com site? jquery is an awesome library and I do not plan on using anything else anytime soon but the manner in which they catalog plugins on the site is terrible. I know these guys are capable of much better. Ok so you can choose a plugin category but then everything just runs together on that page. The content displayed for each plugin varies wildly depending on how generous the plugin developer was when they added their contribution. The plugin search seems to search through all the pages and their content and the results you get back are pretty vague at times and in many cases you get back duplicates. For example if you search for menu you may get back a bunch of links to pages that have the word menu in them but the page may not be a menu plugin. The Taxonomy is not too bad but I think they should categorize and sub categorize the plugins a little better. A great example of what is needed in the extensions directory at Joomla.com. Even if you just list the plugins more like a product catalog with a link to the main plugin page stuff would be allot easier on the eyes. I know the jquery community has alot of great code to offer but discovering it in the plugins section of jquery.com is quite painful. I am not trying to upset anyone here but jquery and it's plugin directory has outgrown the Drupal/CCK limitations.
[jQuery] validation plugin addMethod does not work for me.
what am I doing wrong here? I cannot figure out how to use the addMethod(). var frmSubmittal = $(#frmSubmittal); //validates the form frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) {error.prependTo ( element.parents(div.ctrlHolder));}, errorElement:'div', errorClass:'valerror' }); $.validator.addMethod( company, function(value, element) {alert (hello); return false;}, Enter a Company Name );
[jQuery] Re: loading message shows up after page has loaded
I think there is a bit of confusion here as to how Coldfusion works. By default the Coldfusion server will return the generated HTML all at once. So if you have a long query your not going to get even the first bit of the document until the CF server is done with it. What your asking your .js to do is when the page begins to load show a loading image and when it's done hide it. Well Coldfusion will give your the entire document at once, even if there is a huge grid with data in it you get all of it at once after CF is done creating it and chances are if you have a fast connection even if the document weight is up there your not going to get the behavior your looking for. The reason it works with your images is because they take a bit longer to download and they download after the document has been served from the CF server. The markup returned from the server tells the browser where to load the images from. What you need to do is have the CF server stream the document to you as it generates it. This can be done using the cflush tag. http://cfquickdocs.com/cf8/?getDoc=cf#cfflush if you use this properly you can start sending the headers and stuff to the client browser right away and your .js being in the head of the document should execute as well. The other trick would be to use AJAX to load your query result and inject it into the page or pass it to some data handling .js. With AJAX you can use the events that fire before the request begins and after it completes to toggle a neat-o loading image. HTH On Oct 21, 8:17 pm, Rick Faircloth r...@whitestonemedia.com wrote: Mike! Crawl back under your rock, you fathead!!! There...how's that? :o) Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike Alsup Sent: Wednesday, October 21, 2009 7:51 PM To: jQuery (English) Subject: [jQuery] Re: loading message shows up after page has loaded Hope that helps. --Karl Bah, this is getting entirely too civil. Snooze... :-)
[jQuery] confused about form validation showErrors() method
I am trying to use the showErrors() method as a back up to the client side validation, My form have server side validation that returns a json string of invalid fields and a message for each and I was hoping to use that along with showErrors(). It seems like the only way I can get showErrors() to work is to hard code the string to pass in. if I hard code validator.showErrors({checknumber : The check number is required}) it works like a charm. but var str = {myfieldnamevar : myerrormessagevar}; validator.showErrors(str) ; OR var str = '{' + myfieldnamevar + ' : ' + myerrormessagevar + '}'; validator.showErrors(str) ; neither work, what am I doing wrong? can I even pass the field and message in as a variable?
[jQuery] Managing scripts in AJAX applications
One thing I have been struggling with is AJAX applications is managing the js code that powers them. For example if you have a page that loads content from an AJAX call to the server and that content also has js code associated with it in order to function how do I manage that code? If I have 20 pages that get loaded from the server via AJAX at one point or another I do not want to have one huge js file with a bunch of code for each page in it. I was wondering if it's better to embed the js for each page loaded via AJAX or call it separately? Normally when I need chunks of HTML js, like a data grid for example; that get loaded in via AJAX call I do not have this called code in the traditional HTML doc, in other words the HTML being loaded has no HTML head, body etc.. it's just HTML generated by the server and injected into a section of the calling page. So in this situation should I load the script that is required by the HTML via the success callback? Another delima is communicating events and such between chunks of loaded HTML/js, like if I have a Tabs widget and an accordion on the same page and each have content loaded via AJAX and the content in tab 1 needs to bind and interact with events in a section of the accordion content loaded via AJAX.
[jQuery] Re: Accordion v1.5 and interface together cause accordion to stop working
Hi, Another way I think I have it working is if I include the idrag.js, idrop.js and iutil.js files individually, instead of the packed interface.js. I have not fully tested if it works but it appears to. I only need the drag and drop features of interface so far so I am not sure if I will have other problems down the road. Jason On Aug 31, 8:53 pm, henry [EMAIL PROTECTED] wrote: Hi, Do I just do a search and replace? Can you maybe share your modified interface.js that's compatible with the latest jQuery with us? Thanks. Henry On Aug 31, 1:39 pm, Klaus Hartl [EMAIL PROTECTED] wrote: The problem is that interface overwrites jQuery's own animate function, but unfortunately in newer jQuery versions in a way that they behave differently. I had the same problem and renamed all occurrences of animate to ifxAnimate in my interface scripts. --Klaus jman wrote: Hi, I am trying to use accordion and interface on the same page and the accordion will not work. On line 177 of the accordion file the execution goes to the interface file when it is included. If I remove the interface file from the page line 177 of the accordion jumps to the jquery animate function. Any ideas on what is going on? Thanks, Jason
[jQuery] Re: Release: Accordion 1.5
Hi, I am fairly new to jQuery in general, so this question might have been answered somewhere along the way. I have a problem using the accordion plugin with the interface plugin. They don't interact, just including the interface.js file on the same page makes the accordion stop working. It appears the problem is on line 177 complete: settings.finished of the jquery.accordion.js file. When the interface is included the execution jumps to the interface file, when the interface file is not included the execution jumps to jQuery, animate. Any help would be greatly appreciated, Jason On Aug 30, 3:25 pm, Erin Doak [EMAIL PROTECTED] wrote: I agree that people like the animation effects. I'm all for them. The problem is that if a menu/header is still in the opening animation process and the mouse is moved to a new menu/header item the new menu doesn't open at all - no matter how long one waits. That to me is a bug. Erin In the real world, things dont always happen instantly. A sliding door (like on Star Trek) opens with a whoosh. I am sure they could have built a door shield that was opened instantly rather than a whooshing door. Especially with their futuristic technology. However, people like the whoosh. It's possible to have it too long, like whosh. In which case you bump into the door with your nose ( i.e. Supermarket Doors) or whsh in which case it feels like the power it turned up too high, which is jarring. The perfect effect is timed to the Goldilocks principle. Not too quick, not too slow, not the instant the user puts their mouseover, not waiting too long to fire, not too much bounce, not too robot-like. It should be just-right. Glen On 8/30/07, Erin Doak mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: In my opinion (and only my opinion) i think that it is kinda disturbing if we hover on one item and immediately if we hover on another item, the accordian doesn't open for the second item. I think that the interface should always be responsive to the user. If the mouse is over a menu it should activate. The animation is really just an 'extra'. The ability to navigate a web site by accessing the menu items is of paramount importance. One possible solution might be to offer either behavior as an option. Erin On 8/26/07, Jörn Zaefferer mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: Ganeshji Marwaha schrieb: Jörn, this is fantastic... very re-usable as well.. I have a question/suggestion though... When i hover over one of the items, and before the animation completes if i hover over another item, the animation for the second item doesn't occur. Now, i will have to move my mouse out of that item and hover over it again to get the other item to expand. Is it something that can be fixed, or is it a known limitation that we will have to live by... Well, so far that was intended to be a feature, not a bug. The combination of long-running animations with hover is annoying, right. But it is also annoying when the accordion keeps changing on each mouse move, even when you didn't intend to get a different chunk. Fixing it isn't difficult, but it is difficult to decide what the right fix actually is. Your help is appreciated. -- Jörn
[jQuery] accordian and interface conflict
Hi, I am not sure if this is talked about elsewhere, but I have a problem using accordian 1.5 with the interface plugin. The problem is that when I click to open a different part of the accordian it does not show up. Following it in firebug the code jumps to the interface plugin at line 177 complete: settings.finished. When the interface is not included it, jumps to jQuery animate. Also, I may have been a little too quick to create a bug report over at the jquery plugin site. If this is something that is already known about, I will cancel by buy request. Thanks, Jason
[jQuery] Accordion v1.5 and interface together cause accordion to stop working
Hi, I am trying to use accordion and interface on the same page and the accordion will not work. On line 177 of the accordion file the execution goes to the interface file when it is included. If I remove the interface file from the page line 177 of the accordion jumps to the jquery animate function. Any ideas on what is going on? Thanks, Jason
[jQuery] Re: jQuery.validator.addMethod How To
On May 10, 2:37 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: JMan schrieb: Hello, I am using the form validation plugin and I am stuck on the addMethod. I have created a method using the addMethod function, in this I have an ajax call to a server side page that validates the passed value. Every thing works ok except I cannot figure out how to get the new userNameInUse method I created to return true or false based on the result of the ajax call. With the current design that isn't possible with asynchronous calls. For a workaround, add async:false to the $.ajax options. With that the validation method doesn't return until the request finished. -- Jörn Zaefferer http://bassistance.de Thank you! I was able to look at the httprequest object but it was getting returned too soon and did not have any response text yet. Your recomendation should fix me right up... Thanks again!
[jQuery] jQuery.validator.addMethod How To
Hello, I am using the form validation plugin and I am stuck on the addMethod. I have created a method using the addMethod function, in this I have an ajax call to a server side page that validates the passed value. Every thing works ok except I cannot figure out how to get the new userNameInUse method I created to return true or false based on the result of the ajax call. here is my code... jQuery.validator.addMethod( userNameInUse, function(value) { $.ajax({ type: GET, url: check.cfm, data: name= + value, complete: handleResults }); function handleResults(r){ //alert(r.responseText); } }, That username is already in use, please enter a different username);