Removing (unbind) a click by class
Hello, I am trying to remove a click handler based on the status of an elements class. I have a few hundred appointments on a jQuery calendar populated from a DB and I would like to remove the click handlers on the appointments that are either full or out of date. Can jQuery remove these click handlers based solely on the class that is applied?
Please help : How to get the link <a> for Ajax from Servlet response ? for user to "sign-in"
Hi, i am new in jQuery ($). A. Here is the servlet. public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { UserService userService = UserServiceFactory.getUserService(); String thisUrl = req.getRequestURI(); resp.setContentType("text/html"); if (req.getUserPrincipal() != null) { //code } else { resp.getWriter().println("<p>Please <a href=\"" + userService.createLoginURL(thisUrl) + "\">sign in</a>.</p>"); System.out.println("no
jquery css() issue
Hi; I have a full viewport div I want to clip in a user clicked area and animate the clip back to the div's original size creating an effect of a growing rectangle that starts from the clicked area to cover the screen.(ala http://codepen.io/guykatz/pen/OXyLge) my simplified code is as follows: myDiv.css('clip','rect(50px, 400px, 500px, 50px)');// rect values are calculated from the user click myDiv.css('clip','rect(0px, 100vw, 100vh,0px)'); the code above does not seem to work well. I am not sure
How to convert all form data to xml, then send xml to server?
I have a standard ASP web form like this: <asp:Content ID="Content8" ContentPlaceHolderID="MainContent" runat="server"> <fieldset> <asp:Label ID="lblFirstName" runat="server" Text="First Name:"></asp:Label> <asp:TextBox ID="tctFirstName" runat="server"></asp:TextBox> <asp:Label ID="lblLastName" runat="server" Text="Last Name:"></asp:Label> <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox> <asp:Label ID="lblEmail" runat="server" Text="E-Mail:"></asp:Label> <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
Set the focus on page load but only if the page is loaded by clicking on a certain link
Hi, In the header of my page there is a link which loads the Login page. On the login page I have two links: Login link and Register link. Inside the login page if I click on "Login" link it reloads the page. If I click on "Register" link it loads the register page. What I'm trying to achieve is this: If I click on the "login" link in the header and the login page is loaded, the focus should be on the login link inside the page.This is easy, I just need to set the focus on document.ready. But now
Print only the specific content on the page
Do we have an option to print only specific content on a webpage using Jquery?
On Submit Register display only the register form
Hi, I have two forms on one single page: "Sign in" form and ''Register" form. Each time the page loads it shows only the "Sign in" form. However I have two buttons on the top of the page: "Sign in" and "Register", which enable me to toggle between the two forms. If I click on "Register" button, the "Sign in" form gets hidden and if I click on "Sign in" button, the "Register" from gets hidden. You can see my example here: Toggle between two forms on same page It works. However the problem is that
Loop required form inputs
I'm trying to loop through all inputs in a form that have type of text. Below is typ. html: <form class="cd-form floating-labels"> <fieldset> <div class="icon"> <label class="cd-label" for="cd-name">Name</label> <input class="user" type="text" name="cd-name" id="cd-name" required> </div> </fieldset> </form> I keep getting error on each - is not a function & is not defined: $('form.cd-form input[type=text]').prop('required').each(function() { if ($(this).val() == '') { ... handle
jquery date picker
Hello I am using jQuery date picker, it does not showing Previous and Next button on date picker until I move my cursor on this picker window. I see same issue in IE 11 and Firefox. can you please help.. $(document).ready(function() { $( ".date" ).datepicker(); });
Predict li from the click event
Hi, I am having 4 li tags Like <ul> <li></li> <li></li> <li></li> <li></li></ul> When I click on the li it should do any action it should stay in the same place. Any idea how to achieve this.
Get and update Youtube playlist on webpage
Hi, For a school project i need to display youtube video's on my webpage. If a new video is uploaded to the Youtube account/playlist, this also has to be displayed. Now, i asume i need to "GET" an array with objects from the Youtube playlist, and seperate these using a forloop. The question is, how do i do that? Thank you alot for your help in advance Best regards, Thomas.
jquery comparison
check this fiddle http://jsfiddle.net/gzkc0u5v/1/ i fix the value of qty like 50 but i want that if some one write 60 in qty field then it will give me alert can t write greater value and return me 50 in qty field.can any one help me out
Setting up click function does not work in a for loop
I'm using jQuery for some time now. There is a problem I cannot resolve The following is working fine $( '#mehrUnsereKunden' ).click(function ( ) { setzeAuf ( this.id, 'myUnsereKunden' ) ; }); $( '#mehrUnternehmen' ).click(function ( ) { setzeAuf ( this.id, 'myUnternehmen' ) ; }); $( '#mehrWasWirBieten' ).click(function ( ) { setzeAuf ( this.id, 'myWasWirBieten' ) ; }); If I write this as a for loop, it does not work anymore var kapitelListe = new Array ( "WasWirBieten", "UnsereKunden",
How to add a pseudo-element in jquery
$('.email').blur(function() { if (!validateEmail($(this).val()) ) { $(this).removeClass("blur").addClass("focus"); } else { $(this).removeClass("focus").addClass("blur"); } }) <input type="email" size="61" class="email"></input> .focus{border: 1px solid red;outline: none;} .blur{border: 1px solid #7dc855;outline: none; } .focus:after{ content: "\00D7"; position: relative; top: -24px; left: 500px; color: red; } .blur + label:before{ content: "\2713"; position: relative; top: -24px; left: 500px; color:
jquery format date?
i have a column that is showing the date as date and time with seconds (t's coming from a database). How do i format the date into UK date, dd,mnm,yyyy? Cheers.
Get only X amount of characters in a div?
I only want the first 300 characters of a div named .newsbody and then put "..." after it. I can't work out how to trim the div to 300 chars, any links to help me?
Issues with IE11 (fixed)
Unsure what is going on, but the code works in Firefox, Chrome, and Edge, but in IE11, the input elements don't seem to be working at all. Here is the URL
When i add onclick to my jquery it goes wrong
I have this code that works fine but as soon as i add values to the openInDialog functioni get errors. Here it is without the values function putContent(data){ jQuery('#dis-wrapper').empty(); for(var i= 0 ;i<data.length;i++){ jQuery('#dis-wrapper').append('<div class="list-group-item"><a href="#" onclick="openInDialog();"><h4 class="list-group-item-heading">'+ data[i]['Title'] +'</h4></a><div class="list-group-item-text">'+data[i]['Created']+'</div></div>'); }As
How to get specific dates within a date range
Hi All, Below is the scenario. Start Date : Feb 5 End Date: Feb 20 I need to find which all other date ranges falls in this range. Other date ranges are Record 1 Start Date : Feb 1 End Date: Feb 15 Record 2 Start Date : Jan 27 End Date: Feb 27 Record 3 Start Date : Feb 15 End Date: Feb 21 My output needs to be like this below. Record 1: Feb 5, Feb 6, Feb 7 ...... Feb 15 Record 2: Feb 5, Feb 6, Feb 7 ...... Feb 20 Record 3: Feb 15, Feb 16, Feb 17.... Feb 20 Please advise how to loop this condition
How to get all A Tags except within a div class?
Hello, a short script puts animations to all anchors (a href starting with #) of my site. This works fine. In my script i use: var allLinks = document.getElementsByTagName('a'); I know this is not jquery but: With jquery how can i get all A Tags from my page except these one/s within a specified div class? Greets
Set a flag for the state being toggled
Hi, Some one made for this code which I wrote: $('.js-showHidePassword').on('click',function(e) { $(this).html(($(this).html() === '<span class="hidden_clip">click this button to show or hide the password</span><span aria-hidden="true">Hide</span>' ? '<span class="hidden_clip">click this button to show or hide the password</span><span aria-hidden="true">Show</span>' : '<span class="hidden_clip">click this button to show or hide the password</span><span aria-hidden="true">Hide</span>'));
Using text input as event for animations?
Like almost everyone says in their questions, I am relatively new to Jquery, not coding though. I am currently trying to m ake a course coding for children. This is an assignment for school. I want to make a game in which a charachter has to code in a popup window to get past certain obstacles. for instance: when he/she incounters a river, a window will open in which the children are able to code: make(bridge); I know how to do the animations but I have no idea how to make the window in which people
event handler attached using 'on' on document is executing content like event bubbling from old response to new one.
<!DOCTYPE html> <html> <head> <title>JS Test</title> <script type="text/javascript" src="js/plugins/jquery-1.8.3.min.js"></script> </head> <body> <h1>Js Test</h1> <button id="getContent">Get Dynamic Content via Ajax call !</button> <div id="content"> </div> <div id="status"></div> <script> $(function(){ $("#getContent").click(function(event){ $.ajax({ url : "./file/hello", success : function(result, status, xhr){ $("#content").html(result); $("#status").html("Success!"); }, error : function(xhr,
Jquery conflict help
Hello, I have 2 jqeury code on my site but they are conflicting, any idea how to remedy to this please? Thanks code 1 jQuery.noConflict()(function($){ "use strict"; /* Tabs */ jQuery('.shortcode_tabs').each(function(index) { var i = 1; jQuery('.shortcode_tab_item_title').each(function( index) { jQuery(this).addClass('it' + i); jQuery(this).attr('whatopen', 'body' + i); jQuery(this).addClass('head' + i); jQuery(this).parents('.shortcode_tabs').find(
When button checked change background color of containing div.
<script> $('.radio-btn').click(function() { if( $(this).is(':checked')) { $document.getElementsByClassName("row").addClass("hvr"); } }); </script> .hvr { background-color: #f2f2f2; } <div class="row"><input type="radio" class="radio-btn" name="payment-options" /></div> When I click on the radio button I want the background color of the containing div to change. What I have here isn't working. Can anybody help?
how to get a value from an option select?
get value of an option select from my website here: website When selecting a town from the top left drop down. nothing is being alerted?! $('.townslist select').change(function() { alert("Selected"); var town = $(this).val(); alert( "Selected " + town ); });
Div box as dynamic form element
I want to make a large box into a form element. When the box is selected it should be submitted to the form. How do I change a div into a form element?
Why "this()" is not working here
Hi, This works: if( $('.messages.error').length ) { $('.messages.error').focus(); } But this doesn't: if( $('.messages.error').length ) { $(this).focus(); } Why?
Accessibility: By clicking on button move the focus to the input
Hi, Looking at my example here (sorry for the messy code, only the jQuery part is relevant): On button click move the focus to input I want to achieve that when I click on "Register" button, the focus move from the button to the input field "First Name". But it doesn't work with the first click. It works only if I click a second time on the "Register" button. Why is that? How can I fix this? Thanks
How to toggle attribute
Hi, I need to create a button which shows and hide the password inside an input field. I wrote this code which works partially: $('.show-hide-password').click(function(e) { $(this).text(($(this).text() === 'Hide' ? 'Show' : 'Hide')); // Change the text $('.engage-password__field').attr('type', 'text'); e.preventDefault(); }); If I click on "Show" button it shows the password. But it should hide the password by second click. So I need something to toggle the attribute each time
Logic for solving date vs hours allocation
Hi All, I am trying to achieve the below. I can assign only 9 hours for an user in a single day. Below is the form I have submitted to database. Resource name : John Start Date : 1st May 2016 End Date : 31st May 2016 Hours Allocated: 5 Project: ABC Now the above form is submitted to database. This is phase 1 Now the phase 2 is, I need to add 7 hours for John for another project XYZ for date from 15th May to 31st May 2016. But here I can add only 4 hours and not 7, because allowable limit in a day
Slide up panel multiple divs
Hello all, I have set up a website using a custom joomla template. I have multiple divs on the front page with slide up divs in each of them. The class names and the id's are the same and I do not have a lot of control over that. When I hover over any of the panels only the first slide up div activates. Here is a link Jfiddle. I would like to be able to hover over the trigger in any one div and activate only that divs slide up panel. Can someone please help me.
Position of image in CANVAS
Hi, everyone. I need help with the following. I am new on this and I am trying to position an image as in below (in the middle of the canvas and with no zoom): But, now, if you check it (http://www.lotejoven.com.ar/plano_test.php ) you have to move the image like five times to start to see it as it is position in top and left you can see all blank when it starts the page. Here it goes the code: HOPE YOU CAN HELP ME! THANKS A LOT. <canvas width="500" ></canvas> <script src="http://lotejoven.com.ar/assets/js/stopExecutionOnTimeout.js"></script>
How to add a custom message in a SharePoint Webpart using Jquery
Team, I want to add a custom message at the bottom of a webpart running on SharePoint 2013. Got it know it can be done using Jquery, please suggest how to do it.
jqueryjavascript to compare input text fields value
Hello Can you please provide sample example to compare multiple text field values, if any of those values are same then mark those textfileds as RED Color Thanks
Showing a log when deleting folders and content
I'm working on my administration panels mailbox implementing a delete feature for the mailbox folders, however as I am not familiar with PHP, this is just somewhat of a simulation. Currently I simply delete the list item which was clicked of which the class '.clicked' is applied to $(clicked).remove(); However I'd like to show a log such as the following; Moving <NUM*> e-mails from <SUB-FOLDER**> into trash folder Moving <NUM*> e-mails from <SUB-FOLDER**> into trash folder Deleting folders... *For
Json: Returning List of Objects In Ajax call 500 error
I'm having trouble with an ajax call. When I try to pass a string in it works, but when I try to pass a list of objects in it does not work? I tried debugging and the list is definitely populated. But when I try running it with a list I keep getting a 500 (Internal Server Error)? Any suggestions would be very much appreciated!! Ajax Call: $(function () { $('input[type=checkbox]').change( function () { if (this.checked) { $.post("/Authentication/GetProfiles", {}, function
setTimeout() not timing out
Hi, In using setTimeout() to show and hide a message the message just flashes on and off. Timer is not working. Hope someone can spot something wrong here. UPDATE: I commented out window.location.assign("fields.php"); and setTimeout works properly. See 5. below. if(update) { $.ajax({ type: "POST", url: "changeData.php", data: { "col":col, "update":update}, dataType: "text", success: showChangedData }); // ajax function
what is wrong with how I am trying to set opacity?
The disabled property gets set correctly, but opacity doesn't change. I call the function like this: disables(true,'0.2'); function disables(parm1,parm2) { var debug = 0; if (debug==1) alert('disables called with ' + parm1 + ',' + parm2); $("#divSearch :input").prop("disabled", parm1); $("#divSearch :input").css('opacity',parm2); return true; }
How to get the cildselector in $(selector).on(event,childSelector,data,function,map)
Hi. I have a problem. I append a select with class .ExtDestination . May user add 10 select with this class. This selects have also unique id. I want to get id of changed select. I use below code but it not works: $(document).ready(function() { $('body').on('change' , $('.ExtDestination') , function() { console.log(<id of changed select>); }); }); how can i get this id . $(this).attr('id')) do not word because this point to body.
Next Page