JavaScript - Jquery Validation Plugin Problem
Hello guys,
I have implemented the jquery validation in one of my projects. I have a <div> which has all the billing details & another <div> below it which has the shipping details. There is a checkbox in between these <div>'s which says "Same as Billing Address". It is used to populate all the shipping fields from the billing fields. Well, on this particular form there are some fields which are mandatory & which I have validated by jquery validation. I have used the $("#form_id").validate().form(); statement to check validation on the click event of the checkbox. The actual problem is that after page loads, I directly click on the checkbox & submit the page, the page gets submitted & validation does not execute. If I click the submit button with the checkbox unchecked then the validation runs properly. Why is my form not being validated if I checked the checkbox? Please guys, help me out. Thanks in advance. Bhavik. Similar TutorialsIt does not work in ie7! Here is my code and my link... I have been trying to fix for 2 hours now! Please help. I tried using jquery 1.6.1, 1.5.2, min.validation, regular validation, i changed the buttons to input type="submit" and did everything else I could find but nothing works. When you click submit, it does not validate. It goes straight to my thank you page and I get a blank form in return. I do not know much jquery, just enough to know what I copy and paste and make some minimal changes. Thanks! http://www.denver-website-designer.com/quote.html <script type="text/javascript"> $().ready(function() { var erroralert = $("#quoteForm").bind("invalid-form.validate", function() { $("#erroralert"); }); }); $.metadata.setType("attr", "validate"); $.validator.addMethod("ninja", function(value) { return value == "ninja"; }, 'Can a robot spell "ninja"'); $().ready(function() { $("#quoteForm").validate({ errorContainer: $("#erroralert"), rules: { fullname: { required:true, minlength:2, }, email: { required:true, email:true, }, phone: { required:true, minlength:10, maxlength:15, }, pages: { required:true, minlength:1, maxlength:10, number:true }, whyrate: { required:true, minlength:10, }, ninja: "ninja", }, messages: { email: "Please enter a valid email address", pages: "Numeric values only", } }); }); </script> Hello! I am new to the boards, I am a graphic and web designer. Been designing and developing web sites since 2001. I have fun doing it and was lucky enough to have someone hire me to do it and get paid for it. The reason I signed up to the boards is so that I can search for some help since I am starting to learn jQuery I am having a little bit of trouble with a page I am working on and was hoping someone would be able to help me out! The problem: I have a spry collapsable panel with 4 panels, in the panels I have jQuery carousel plugins with the thumbs plugin. The problem I am having is that I want the carousel in the 4 panels like I mentioned before but I can only get one of the panels to function fully. The other three loses their forward back functions. I tried copying the code for the first one and just renaming the classes and functions so it would separate the two. The thumbs plugin will still work, I just can not get the carousel function to repeat on another one. I will post the code I have left off with. If you need to see the page you can message me. Thanks for reading and if you can help it will be great! Here is the java: Code: $(document).ready(function () { $('.infiniteCarousel').infiniteCarousel(); }); $.fn.infiniteCarousel = function () { function repeat(str, num) { return new Array( num + 1 ).join( str ); } return this.each(function () { var $wrapper = $('> div', this).css('overflow', 'hidden'), $slider = $wrapper.find('> ul'), $items = $slider.find('> li'), $single = $items.filter(':first'), singleWidth = $single.outerWidth(), visible = Math.ceil($wrapper.innerWidth() / singleWidth), currentPage = 1, pages = Math.ceil($items.length / visible); if (($items.length % visible) != 0) { $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible))); $items = $slider.find('> li'); } $items.filter(':first').before($items.slice(- visible).clone().addClass('cloned')); $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned')); $items = $slider.find('> li'); // reselect $wrapper.scrollLeft(singleWidth * visible); function gotoPage(page) { var dir = page < currentPage ? -1 : 1, n = Math.abs(currentPage - page), left = singleWidth * dir * visible * n; $wrapper.filter(':not(:animated)').animate({ scrollLeft : '+=' + left }, 500, function () { if (page == 0) { $wrapper.scrollLeft(singleWidth * visible * pages); page = pages; } else if (page > pages) { $wrapper.scrollLeft(singleWidth * visible); // reset back to start position page = 1; } currentPage = page; }); return false; } $wrapper.after('<a class="arrow back"><</a><a class="arrow forward">></a>'); $('a.back', this).click(function () { return gotoPage(currentPage - 1); }); $('a.forward', this).click(function () { return gotoPage(currentPage + 1); }); $(this).bind('goto', function (event, page) { gotoPage(page); }); }); }; //Carousel 2 $('.infiniteCarouselTwo').infiniteCarouselTwo(); $.fn.infiniteCarouselTwo = function () { function repeat(str, num) { return new Array( num + 1 ).join( str ); } return this.each(function () { var $wrapperTwo = $('> div', this).css('overflow', 'hidden'), $slider = $wrapperTwo.find('> ul'), $items = $slider.find('> li'), $single = $items.filter(':first'), singleWidth = $single.outerWidth(), visible = Math.ceil($wrapperTwo.innerWidth() / singleWidth), currentPage = 1, pages = Math.ceil($items.length / visible); if (($items.length % visible) != 0) { $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible))); $items = $slider.find('> li'); } $items.filter(':first').before($items.slice(- visible).clone().addClass('cloned')); $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned')); $items = $slider.find('> li'); // reselect $wrapperTwo.scrollLeft(singleWidth * visible); function gotoPage(page) { var dir = page < currentPage ? -1 : 1, n = Math.abs(currentPage - page), left = singleWidth * dir * visible * n; $wrapperTwo.filter(':not(:animated)').animate({ scrollLeft : '+=' + left }, 500, function () { if (page == 0) { $wrapperTwo.scrollLeft(singleWidth * visible * pages); page = pages; } else if (page > pages) { $wrapperTwo.scrollLeft(singleWidth * visible); // reset back to start position page = 1; } currentPage = page; }); return false; } $wrapperTwo.after('<a class="arrow back"><</a><a class="arrow forward">></a>'); $('a.back', this).click(function () { return gotoPage(currentPage - 1); }); $('a.forward', this).click(function () { return gotoPage(currentPage + 1); }); $(this).bind('goto', function (event, page) { gotoPage(page); }); }); }; Here is the CSS: Code: .infiniteCarousel { width: 395px; position: relative; } .infiniteCarousel .wrapper { width: 825px; /* .infiniteCarousel width - (.wrapper margin-left + .wrapper margin-right) */ overflow: auto; min-height: 10em; position: absolute; top: 0; margin-top: 0; margin-right: 40px; margin-bottom: 0; margin-left: 40px; left: 20px; } .infiniteCarousel ul a img { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .infiniteCarousel .wrapper ul { width: 9999px; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0; padding:0; position: absolute; top: 0; } .infiniteCarousel ul.thumb li { display:block; float:left; padding: 10px; height: 85px; width: 85px; -ms-interpolation-mode: bicubic; } .infiniteCarousel ul.thumb li a img { display:block; } .infiniteCarousel .arrow { display: block; height: 36px; width: 37px; text-indent: -999px; position: absolute; top: 25px; cursor: pointer; background-image: url(../images/arrow.png); background-repeat: no-repeat; background-position: 0 0; } .infiniteCarousel .forward { background-position: 0 0; right: 0; background-image: url(../images/arrow.png); background-repeat: no-repeat; left: 910px; } .infiniteCarousel .back { background-position: 0 0px; left: 0; background-image: url(../images/arrow-back.png); background-repeat: no-repeat; } .infiniteCarousel .forward:hover { background-position: 0 0px; background-image: url(../images/arrow.png); background-repeat: no-repeat; } .infiniteCarousel .back:hover { background-position: 0 0px; background-image: url(../images/arrow-back.png); } ul.thumb li img.hover { background:url(thumb_bg.png) no-repeat center center; border: none; } #main_view { } /* Carousel Two */ .infiniteCarouselTwo { width: 395px; position: relative; } .infiniteCarouselTwo .wrapperTwo { width: 825px; /* .infiniteCarouselTwo width - (.wrapperTwo margin-left + .wrapperTwo margin-right) */ overflow: auto; min-height: 10em; position: absolute; top: 0; margin-top: 0; margin-right: 40px; margin-bottom: 0; margin-left: 40px; left: 20px; } .infiniteCarouselTwo ul a img { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .infiniteCarouselTwo .wrapperTwo ul { width: 9999px; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0; padding:0; position: absolute; top: 0; } .infiniteCarouselTwo ul.thumbTwo li { display:block; float:left; padding: 10px; height: 85px; width: 85px; -ms-interpolation-mode: bicubic; } .infiniteCarouselTwo ul.thumbTwo li a img { display:block; } .infiniteCarouselTwo .arrow { display: block; height: 36px; width: 37px; text-indent: -999px; position: absolute; top: 25px; cursor: pointer; background-image: url(../images/arrow.png); background-repeat: no-repeat; background-position: 0 0; } .infiniteCarouselTwo .forward { background-position: 0 0; right: 0; background-image: url(../images/arrow.png); background-repeat: no-repeat; left: 910px; } .infiniteCarouselTwo .back { background-position: 0 0px; left: 0; background-image: url(../images/arrow-back.png); background-repeat: no-repeat; } .infiniteCarouselTwo .forward:hover { background-position: 0 0px; background-image: url(../images/arrow.png); background-repeat: no-repeat; } .infiniteCarouselTwo .back:hover { background-position: 0 0px; background-image: url(../images/arrow-back.png); } ul.thumbTwo li img.hover { background:url(thumb_bg.png) no-repeat center center; border: none; } #main_viewTwo { } Here is the HTML: Code: <div id="around" class="CollapsiblePanel"> <div class="CollapsiblePanelTabBlue" tabindex="1">Around town</div> <div class="CollapsiblePanelContent"> <div id="main_viewTwo"> <img src="images/placeholder.jpg" alt="placeholder" width="938" height="273" /> </div> <!-- Start Carousel --> <div class="infiniteCarouselTwo"> <div class="wrapperTwo"> <ul class="thumbTwo"> <li><a href="images/placeholder.jpg"><img src="images/carouhold1.png" alt="Holder image" width="51" height="51" /></a>1</li> <li><a href="images/placeholder2.jpg"><img src="images/carouhold2.png" width="51" height="51" alt="Holder image" /></a>2</li> <li><a href="images/placeholder3.jpg"><img src="images/carouhold3.png" width="51" height="51" alt="Holder image" /></a>3</li> <li><a href="images/placeholder4.jpg"><img src="images/carouhold4.png" width="51" height="51" alt="Holder image" /></a>4</li> <li><a href="images/placeholder5.jpg"><img src="images/carouhold5.png" width="51" height="51" alt="Holder image" /></a>5</li> <li><a href="images/placeholder6.jpg"><img src="images/carouhold6.png" width="51" height="51" alt="Holder image" /></a>6</li> <li><a href="images/placeholder7.jpg"><img src="images/carouhold7.png" width="51" height="51" alt="Holder image" /></a>7</li> <li><a href="images/placeholder8.jpg"><img src="images/carouhold8.png" width="51" height="51" alt="Holder image" /></a>8</li> <li><a href="images/placeholder9.jpg"><img src="images/carouhold9.png" width="51" height="51" alt="Holder image" /></a>9</li> <li><a href="images/placeholder10.jpg"><img src="images/carouhold10.png" width="51" height="51" alt="Holder image" /></a>10</li> <li><a href="images/placeholder11.jpg"><img src="images/carouhold11.png" width="51" height="51" alt="Holder image" /></a>11</li> <li><a href="images/placeholder12.jpg"><img src="images/carouhold12.png" width="51" height="51" alt="Holder image" /></a>12</li> <li><a href="images/placeholder13.jpg"><img src="images/carouhold13.png" width="51" height="51" alt="Holder image" /></a>13</li> <li><a href="images/placeholder14.jpg"><img src="images/carouhold14.png" width="51" height="51" alt="Holder image" /></a>14</li> <li><a href="images/placeholder15.jpg"><img src="images/carouhold15.png" width="51" height="51" alt="Holder image" /></a>15</li> <li><a href="images/placeholder16.jpg"><img src="images/carouhold16.png" width="51" height="51" alt="Holder image" /></a>16</li> </ul> </div> </div> <!--End Carousel--> </div> </div> <div id="campus" class="CollapsiblePanel"> <div class="CollapsiblePanelTabGreen" tabindex="1">Campus life</div> <div class="CollapsiblePanelContent"> <div id="main_view"> <img src="images/placeholder.jpg" alt="placeholder" width="938" height="273" /> </div> <!-- Start Carousel --> <div class="infiniteCarousel"> <div class="wrapper"> <ul class="thumb"> <li><a href="images/placeholder.jpg"><img src="images/carouhold1.png" alt="Holder image" width="51" height="51" /></a>1</li> <li><a href="images/placeholder2.jpg"><img src="images/carouhold2.png" width="51" height="51" alt="Holder image" /></a>2</li> <li><a href="images/placeholder3.jpg"><img src="images/carouhold3.png" width="51" height="51" alt="Holder image" /></a>3</li> <li><a href="images/placeholder4.jpg"><img src="images/carouhold4.png" width="51" height="51" alt="Holder image" /></a>4</li> <li><a href="images/placeholder5.jpg"><img src="images/carouhold5.png" width="51" height="51" alt="Holder image" /></a>5</li> <li><a href="images/placeholder6.jpg"><img src="images/carouhold6.png" width="51" height="51" alt="Holder image" /></a>6</li> <li><a href="images/placeholder7.jpg"><img src="images/carouhold7.png" width="51" height="51" alt="Holder image" /></a>7</li> <li><a href="images/placeholder8.jpg"><img src="images/carouhold8.png" width="51" height="51" alt="Holder image" /></a>8</li> <li><a href="images/placeholder9.jpg"><img src="images/carouhold9.png" width="51" height="51" alt="Holder image" /></a>9</li> <li><a href="images/placeholder10.jpg"><img src="images/carouhold10.png" width="51" height="51" alt="Holder image" /></a>10</li> <li><a href="images/placeholder11.jpg"><img src="images/carouhold11.png" width="51" height="51" alt="Holder image" /></a>11</li> <li><a href="images/placeholder12.jpg"><img src="images/carouhold12.png" width="51" height="51" alt="Holder image" /></a>12</li> <li><a href="images/placeholder13.jpg"><img src="images/carouhold13.png" width="51" height="51" alt="Holder image" /></a>13</li> <li><a href="images/placeholder14.jpg"><img src="images/carouhold14.png" width="51" height="51" alt="Holder image" /></a>14</li> <li><a href="images/placeholder15.jpg"><img src="images/carouhold15.png" width="51" height="51" alt="Holder image" /></a>15</li> <li><a href="images/placeholder16.jpg"><img src="images/carouhold16.png" width="51" height="51" alt="Holder image" /></a>16</li> </ul> </div> </div> <!--End Carousel--> </div> </div> Ask me if you need any more information from me. Like I said if you need to see the page message me! It is not a site I want to make too public at the moment for some reasons of who I work for. So, i have this code which retrieves php files for me using jquery and id love to get it working with Jquery history plugin. I tried modifying the code i got from the ajax demo to work for me, but i just couldnt do it as i do not know any javascript really.. ( actually what i tried was simply to change "#ajax-links a" to "#menu li a" and .html to .php ..but nothing.. :rolleyes: Id be very gratefull if someone would help me out with this one. All related code can be found bellow (the ones that should be needed anyways): This is the code that retrieves php files inside "#content" when item from "#menu li a" with the specified id is clicked Code: $(document).ready(function(){ //References var change = $("#menu li a"); var loading = $("#loading"); var content = $("#content"); //Manage click events change.click(function(){ //show the loading bar showLoading(); //load selected section if(this.id == "home") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/index.php", hideLoading); content.slideDown(); } else if(this.id == "secondpage") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/secondpage.php", hideLoading); content.slideDown(); } else { //hide loading bar if there is no selected section hideLoading(); } }); //show loading bar function showLoading(){ loading .css({visibility:"visible"}) .css({opacity:"1"}) .css({display:"block"}) ; } //hide loading bar function hideLoading(){ loading.fadeTo(1000, 0); }; }); Heres the structure of the menu/content Code: <ul id="menu"> <li><a id="home" class="normal" href="#Home"></a></li> <li><a id="secondpage" class="normal" href="#Secondpage"></a></li> </ul> <div id="content"> <ul id="sec-menu"> <li><a id="link1" class="normal" href="#">Link1</a></li> <li><a id="link2" class="normal" href="#">Link2</a></li> </ul> </div> Heres the code that jquery history plugin uses in demo for ajax Code: jQuery(document).ready(function($) { function load(num) { $('#content').load(num +".html"); } $.history.init(function(url) { load(url == "" ? "1" : url); }); $('#ajax-links a').live('click', function(e) { var url = $(this).attr('href'); url = url.replace(/^.*#/, ''); $.history.load(url); return false; }); }); I'm using a horizontal coda slider for nav and an image viewer (ceebox)....all jquery. I am trying to incorporate a lava lamp (also jquery) effect on the navigation. I can either get the viewer/slider to work (but lavaLamp doesn't) or the reverse......can't get them all. I've tried everything and have the issue narrowed down to the "easing" jquery plugin. With it lava lamp works but the rest doesn't and w/o it lava doesn't. Has anyone had this issue....anyone know how to resolve it? http://seeyatom.com/ on my site he http://www.jbiddulph.com/niche/ I would like to apply an opacity on my navigation roll over, can someone help me here?! here is the code for my Home link: Code: $('#nav ul li.home').hover( function() { $(this).stop().animate({backgroundColor:'#ff8300'}, 1300); }, function () { $(this).stop().animate({backgroundColor:'#666666'}, 100); }); I did have this in another category but i think it was the wrong one, so i am now posting it here i found this script which ran great for the new year. I have been trying to change it so it counted down from todays date to a new date in the future instead of from a date picked to the new year. I have the code here, how would i go about doing this. jquery script Code: (function($){ // Number of seconds in every time division var days = 24*60*60, hours = 60*60, minutes = 60; // Creating the plugin $.fn.countdown = function(prop){ var options = $.extend({ callback : function(){}, timestamp : 0 },prop); var left, d, h, m, s, positions; // Initialize the plugin init(this, options); positions = this.find('.position'); (function tick(){ // Time left left = Math.floor((options.timestamp - (new Date())) / 1000); if(left < 0){ left = 0; } // Number of days left d = Math.floor(left / days); updateDuo(0, 1, d); left -= d*days; // Number of hours left h = Math.floor(left / hours); updateDuo(2, 3, h); left -= h*hours; // Number of minutes left m = Math.floor(left / minutes); updateDuo(4, 5, m); left -= m*minutes; // Number of seconds left s = left; updateDuo(6, 7, s); // Calling an optional user supplied callback options.callback(d, h, m, s); // Scheduling another call of this function in 1s setTimeout(tick, 1000); })(); // This function updates two digit positions at once function updateDuo(minor,major,value){ switchDigit(positions.eq(minor),Math.floor(value/10)%10); switchDigit(positions.eq(major),value%10); } return this; }; function init(elem, options){ elem.addClass('countdownHolder'); // Creating the markup inside the container $.each(['Days','Hours','Minutes','Seconds'],function(i){ $('<span class="count'+this+'">').html( '<span class="position">\ <span class="digit static">0</span>\ </span>\ <span class="position">\ <span class="digit static">0</span>\ </span>' ).appendTo(elem); if(this!="Seconds"){ elem.append('<span class="countDiv countDiv'+i+'"></span>'); } }); } // Creates an animated transition between the two numbers function switchDigit(position,number){ var digit = position.find('.digit') if(digit.is(':animated')){ return false; } if(position.data('digit') == number){ // We are already showing this number return false; } position.data('digit', number); var replacement = $('<span>',{ 'class':'digit', css:{ top:'-2.1em', opacity:0 }, html:number }); // The .static class is added when the animation // completes. This makes it run smoother. digit .before(replacement) .removeClass('static') .animate({top:'2.5em',opacity:0},'fast',function(){ digit.remove(); }) replacement .delay(100) .animate({top:0,opacity:1},'fast',function(){ replacement.addClass('static'); }); } })(jQuery); The section that inilialises it: Code: $(function(){ var note = $('#note'), ts = new Date(2012, 0, 1), newYear = true; if((new Date()) > ts){ // The new year is here! Count towards something else. // Notice the *1000 at the end - time must be in milliseconds ts = (new Date()).getTime() + 10*24*60*60*1000; newYear = false; } $('#countdown').countdown({ timestamp : ts, callback : function(days, hours, minutes, seconds){ var message = ""; message += days + " day" + ( days==1 ? '':'s' ) + ", "; message += hours + " hour" + ( hours==1 ? '':'s' ) + ", "; message += minutes + " minute" + ( minutes==1 ? '':'s' ) + " and "; message += seconds + " second" + ( seconds==1 ? '':'s' ) + " <br />"; if(newYear){ message += "left until the new year!"; } else { message += "left to 10 days from now!"; } note.html(message); } }); }); ive tried making the ts = new Date(2012, 0, 1) like ts = new Date() so it reads today's date and i also tried making timestamp : 0 a date in the future as that is basically what i thought was happening. I have tried a load more stuff but i seam to be making a mess of the code and it does not work after that. Could someone point me in the right direction on where to start and which variables are important within this script. Hi all, I am looking for a script that I can only describe. Often, in facebook, when a new window opens there is only the first few lines of text visible followed by a few dots with an invitation to "read more". Once clicked the additional text expands and becomes visible. I don't even know what this behavior is called so it's hard to get started. Any help or pointers in the right direction will be much appreciated. Anita. Cape Town. does anyone know if there is a jquery image gallery/slider plugin that can be used multiple time on one page?
Hello! So I came across this Featured Content Slider mod (http://css-tricks.com/creating-a-sli...ontent-slider/) which is based on the Coda Slider (http://www.ndoherty.biz/demos-index/) which uses jQuery. However, you'll notice that the Coda Slider has since received an update (2.0). What I'm trying to do is update the mod for the Coda Slider update, which I'll then use to create a WordPress plugin for my site. Thing is, I don't really know JavaScript (only enough to logic my way through simply stuff). A lot of things seemed to have changed in the Coda update, but I can't seem to get things to work properly in the FCS, specifically being able to click a thumbnail and make the slider switch to that one. I'm pretty sure I've ruled out CSS being an issue, leaving the JavaScipt. If anyone's willing to take a look, I've uploaded what I currently have to http://www.thetanooki.com/coda.zip It's a bit rough at the moment, since I'm pretty much using trial and error to figure things out... and don't mind the seemingly useless PHP code at the top of the .js.php file - that's just an example I'm hoping to use for when I eventually make a WordPress plugin out of it. Anyway, index2.html is the one I'm working on, I'm only using index.html (original) as a guide, and the original FCS as well as old version of Coda can be found at the other links above. Thanks in advance; any light that can be shed on this would be a tremendous help! If I've screwed something else up, let me know - I may have overlooked conflicting class names or something like that since the originals aren't my own code and I'm still familiarizing myself. hi Pals, I have a problem regarding the "target" attribute of "a" tag. in my code I use biggerlink jQuery script to give link to p element without come HTML validation problem. I pass the "target" value from PHP to smarty template , but it's not working , When I remove "biggerlink " it works but the link in <p> tag not working . My Tpl file is : Code: {if not empty($campaign)} <div class="securti-adv biggerlink"> {if not empty ($campaign.media)} <a href="{$campaign.url}" {if n($campaign.linkTarget)}target="{$campaign.linkTarget}"{/if} class="thumb"> <img src="{$campaign.image}" title="{$campaign.title1 + $campaign.title2}" alt="{$campaign.title1 + $campaign.title2}" /> </a> {/if} <div class="details"> {if not empty ($campaign.title1) || not empty ($campaign.sub_title)} <a href="{$campaign.url}" {if not empty($campaign.linkTarget)}target="{$campaign.linkTarget}"{/if} title="{$campaign.title1 + $campaign.title2}"> {text2image styleSlug=$campaign.titleStyle1 text=$campaign.title1} {text2image styleSlug=$campaign.titleStyle2 text=$campaign.title2} <span><img src="{$imagesDir}/btn-campaign-meet-security-advisor.png" alt="" title="" /></span> </a> <p> {text2image styleSlug=$campaign.subtitleStyle text=$campaign.subTitle}</p> {/if} </div> </div> <script type="text/javascript" language="javascript"> {literal} $(document).ready(function(){ $('.biggerlink').biggerlink(); }); {/literal} </script> {/if} My plugin code is : Code: (function($) { $.fn.biggerlink = function(options) { // Default settings var settings = { hoverclass:'hover', // class added to parent element on hover clickableclass:'hot', // class added to parent element with behaviour follow: true // follow link? Set to false for js popups }; if(options) { $.extend(settings, options); } $(this).filter(function(){ return $('a',this).length > 0; }).addClass(settings.clickableclass).each(function(i){ // Add title of first link with title to parent $(this).attr('title', $('a[title]:first',this).attr('title')); // hover and trigger contained anchor event on click $(this) .mouseover(function(){ window.status = $('a:first',this).attr('href'); $(this).addClass(settings.hoverclass); }) .mouseout(function(){ window.status = ''; $(this).removeClass(settings.hoverclass); }) .bind('click',function(){ $(this).find('a:first').trigger('click'); }) // triggerable events on anchor itself .find('a').bind('focus',function(){ $(this).parents('.'+ settings.clickableclass).addClass(settings.hoverclass); }).bind('blur',function(){ $(this).parents('.'+ settings.clickableclass).removeClass(settings.hoverclass); }).end() .find('a:first').bind('click',function(e){ if(settings.follow == true) { window.location = this.href; } e.stopPropagation(); // stop event bubbling to parent }).end() .find('a',this).not(':first').bind('click',function(){ $(this).parents('.'+ settings.clickableclass).find('a:first').trigger('click'); return false; }); }); return this; }; })(jQuery); the value of "target" , "_blank" is not work .... I highlight the code part regarding this, please check and give me a solution ASAP. You can mail me at : anes.pa@gmail.com Thanks, Anes So, I know there are lots of threads out there about the jQuery validation plugin and people having issues with IE7, but most of them come down to syntax issues with a closing comma or what not. With that said, I have milled over this code of least a full day now and still have no idea why it fails in IE (all versions) http://jsfiddle.net/rM3ej/4/ Can anyone give me some ideas or insight why this would completely fail? Thanks in advanced. Validation is here - http://jquery.bassistance.de/validate/demo/ - JGrowl is here - http://stanlemon.net/projects/jgrowl.html - How can I get those 2 to work so that a Jgrowl window is activated when a validation from a form is called? I have 2 bucks to give for an answer in my Paypal account - I'm a newb, bare with me Thanks, Jon I am trying to perform an AJAX lookup during form validation onsubmit. It is important that it takes place during submit, but it seems to always return true and allow the form to post even when it should not. I have tried putting the AJAX portion in its own function and having it return true or false to the validation function but also does not seem to work. Here is what the code looks like... Code: $("#companyform").submit(function() { $.ajaxSetup({ cache: false }); $.post("ajax_v2Functions.cfm", { coNum: $("#companyNumber").val() }, function(response) { if(response != "") { alert("That company number is already in use by " + response); $("#companyNumber").focus(); return false; } return false; } , "html"); if($("#companyname").val() == "") { alert("The company name cannot be left blank."); $("#companyname").focus(); return false; } if($("#companyNumber").val() == "") { alert("The company number cannot be left blank."); $("#companyNumber").focus(); return false; } }); Hi all. I am using the Inline Form Validation Engine jQuery plugin found here, and though I have posted at their forum as well, am having a heck of a time (not being well versed in js OR Ajax, unfortunately) All I need to do is edit the code so that when the onSubmit function is processed, it returns only the first error it encounters, rather than keeping and display the array of every error. I have picked through the code several times, and can't seem to find where the array is stored. I thought perhaps I could find a for loop to limit, but am at a complete loss. Is there anyone out there who can help? I can post the code if needed; I didn't want to post the entire file (since I don't know which snippet is the one I need!) Thank you in advance! Hi everyone, I currently use javascript in an anchor tag to submit a form using Code: <a href="#" onClick="document.myformname.submit(); return false;">Submit</a> The only problem is, JQuery doesn't acknowledge that my form has been submitted. Has anyone come up against this problem before? If so, can you please share your work around? Thank you! B Hi, I'd like to use the jQuery validation plugin as seen on the following example: http://docs.jquery.com/Plugins/validation#Example But it doesn't work properly if I use inline/in-filed labels. Any help is appreciated! Rain Lover I have been hard at work coding a fancy JQuery form validation script. Problem is, when I run validation on my form, it seems to work, but no email is sent. But when I disable validation, the email sends just fine. I am fairly new to JavaScript, and need some help pinpointing where my error is. Here is the code. Code: // BEGIN JAVASCRIPT $(function(){ //original field values var field_values = { //id : value 'name' : 'your name', 'email' : 'your email', 'yourmessage' : 'I would like to inquire about' }; //inputfocus $('input#name').inputfocus({ value: field_values['name'] }); $('input#email').inputfocus({ value: field_values['email'] }); $('textarea#yourmessage').inputfocus({ value: field_values['yourmessage'] }); //form validation $('form').submit(function validateForm(){ return false }); // removing this return false seems to mess up validation $('#submit').click(function(){ //remove classes $('#sendamessage input').removeClass('error').removeClass('valid'); //ckeck if inputs aren't empty var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; var fields1 = $('#sendamessage input[type=text],#sendamessage textarea'); var error = 0; fields1.each(function(){ var value = $(this).val(); if( value.length<2 || value==field_values[$(this).attr('id')] || ( $(this).attr('id')=='email' && !emailPattern.test(value) ) ) { $(this).addClass('error'); // css class $(this).effect("shake", { times:3 }, 50); error++; } else { $(this).addClass('valid'); // css class } }); if(!error) { // this is where I get confused. How do I make this send the form? alert('Data sent'); }); } }); }); // END JAVASCRIPT <form method="post" action="" onsubmit="return validateForm()" > <input type="hidden" name="ccf_customhtml" value="1" /> <input type="hidden" name="success_message" value="Thank you for filling out our form!" /> <input type="hidden" name="destination_email" value="dauidus@gmail.com" /> <input type="hidden" name="required_fields" value="" /> <label for="name">Name</label> <input type="text" name="name" id="name" value="your name" /> <label for="email">Email</label> <input type="text" name="email" id="email" value="your email" /> <label for="yourmessage">Your Message</label> <textarea name="yourmessage" id="yourmessage" value="I would like to inquire about" style="margin-bottom:20px;" />I would like to inquire about</textarea> <input class="send submit" id="submit" type="submit" value="" style="position: relative; bottom: -70px; left: 25px; " /> </form> I am using a WordPress plugin to automatically send the contents of the form to email. It works without the javascript enabled. But when I turn on JS the form gets validated, but no email is sent. Please let me know if I should include anything else here... I've been looking at this code so much that I'm having a hard time doing it with fresh eyes. The problem page is on http://new.dauidusdesign.com/contact/. FYI, I am also looking to make this work with the 'request a quote' link on the same page. Cheers! -Dave Please take a look at oceangamer.com Press the login/Sign up in the header of the page. It slides down fine in IE but in mine it refuses to slide up if i click close. Every other browser, it works??? Whats the problem? I am aware that there are common problems with this and that the fix is probably this: Code: $(function() { var zIndexNumber = 1000; $('div').each(function() { $(this).css('zIndex', zIndexNumber); zIndexNumber -= 10; }); }); However I can't figure out how to make my menu get in front of my jquery banner in ie6 and 7!! Ive been literally trying all day. Then I found that site explaining that that code would fix it. however I cannot get it to work with my site! Here is the link to my page: http://bit.ly/5fwhPP I'm not sure if just plopping that javascript before my other scripts will do it but it sounded like it from the page I found the code on. I could really use some help here I am completely jammed up and cant focus on anything else until i fix this stupid issue! Any help is therefore greatly appreciated! |