Swapping rows in JQuery
Here’s another solution. To move a row down: jQuery(“#rowid”).next().after(jQuery(“#rowid”)); To move a row up: jQuery(“#rowid”).prev().before(jQuery(“#rowid”));
Here’s another solution. To move a row down: jQuery(“#rowid”).next().after(jQuery(“#rowid”)); To move a row up: jQuery(“#rowid”).prev().before(jQuery(“#rowid”));
Use: $(this).attr instead of this.attr This forces it into the context of jQuery.
I have done this in my fullcalendar and it’s working perfectly. you can add this code in your select function. select: function(start, end, allDay) { var check = $.fullCalendar.formatDate(start,’yyyy-MM-dd’); var today = $.fullCalendar.formatDate(new Date(),’yyyy-MM-dd’); if(check < today) { // Previous Day. show message if you want otherwise do nothing. // So it will be unselectable … Read more
Give zero to mindate and it’ll disabale past dates. $( “#datepicker” ).datepicker({ minDate: 0}); here is a Live fiddle working example http://jsfiddle.net/mayooresan/ZL2Bc/ The official documentation is available here
This should do it I think $(“#formId input:text, #formId textarea”).first().focus();
Nope, you can’t use it like that. append is an atomic operation, which creates the element directly. // The <ul> element is added to #details, then it is selected and the jQuery // selection is put in the “list” variable. var list = $(‘<ul/>’).appendTo(‘#details’); for (var i = 0; i < 10; i++) { // … Read more
How about $(YOUR_ELEMENT).live(“EVENT_NAME”, function() { $(“.portlet-header”).toggleClass(“ui-icon-plus”).toggleClass(“ui-icon-minus”); }); Even more shorter $(YOUR_ELEMENT).live(“EVENT_NAME”, function() { $(“.portlet-header”).toggleClass(“ui-icon-plus ui-icon-minus”); }); EDIT As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live(). jQuery API reference
You can disable the second validation and make it enabled only when the first is wrong : take a look at this link <form id=”profileForm” method=”post”> <p>Please provide one of these information:</p> <div class=”form-group”> <label class=”control-label”>Social Security Number</label> <input type=”text” class=”form-control” name=”ssn” /> </div> <div class=”form-group text-center”>— Or —</div> <div class=”form-group”> <label class=”control-label”>Driver’s License Number</label> … Read more
The .find(‘selector’) method is basically a recusive version of .children(), and will find any descendant object that matched the selector, as opposed to .children() which only finds objects in the first level of descendants. 2nd EDIT (I phrased badly the first time, and messed up the code a bit!): Ok, I don’t think this functionality … Read more
$(‘#divId’).html(someText).promise().done(function(){ //your callback logic / code here });