add days to a date using jquery
Hi, I want to add days to a particular date using jquery following is my code var days = 15 var sdate = 01-Aug-2016; / var date = new Date(sdate); var newdate = new Date(date); newdate.setDate(newdate.getDate()+15); var nd = new Date(newdate); alert(nd); iam getting invalid date as output How to solve this Regards Baiju
A new input field adding with dropdown value
When a user clicks the "+" button, then a row should be added with a dropdown and input field. I want to make that input field name as a dropdown selected value for each rows. If I select "facebook" in first dropdown, it should not show in the second dropdown list. simply selecting values should NOT display in next dropdown. I done that part. But my question is if I select "Google" in second dropdown, "Yahoo" in third dropdown. and again if i click the first or second dropdown it should NOT display
Custom message when closing the browser/tab
Can someone help me on how to customize the alert message when closing the browser/tab? I have tried all other codes in all forums, no luck. It displays the default alert message of the browser. window.addEventListener("beforeunload", function (e) { var confirmationMessage = "Warning! Do not close, save first"; (e || window.event).returnValue = confirmationMessage; //Gecko + IE sendkeylog(confirmationMessage); return confirmationMessage; //Webkit, Safari, Chrome etc.});
Disable The Previous Months and Years from Jquery Date Picker
Dear Folks, *I have Jquery Date Picker and required to disable the previous months and years from picker *Trying to Use the Property $(".ui-datepicker-prev").remove();. *Can anyone help me what can I add in below code to reach out my requirement $(function() { $( "#datepicker" ).datepicker({ changeMonth: true, // changeYear:true, $(".ui-datepicker-prev").remove(); minDate: new Date('2016/01/01'), maxDate: new Date('2016/12/21'),
change in cell content of salary or bonus or deduction in table cells automatically affect in total
Hi i have table have 5 comnun Name Salary Bonus Deduction Total ahmed 500 500 100 900 calculation of total is Total=Salary+Bonus-Deduction and total in red color according to my code what i need actually if i changed in Salary cell or Bonus cell or Deduction cell affect in total cell suppose i added row above then edit salary from 500 to 2000 meaning in this time row will be as bellow ahmed 2000 500 100 2400 total will be 2400 with green color i can do by button but
After adding row cell in table not converted to textbox issue
Hi I need after i add row convert all cell found in row converted to text box in code below i can add row success but i cannot converted all celles in row to text box i try to make row added as text box but not got my code as below @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.js"></script> <script> $(function () { $("#btn").click(function ()
Find and add class for menu.
I'm working on a simple full width menu whereby the list items are in one div and the inner menu is somewhere else. i have done a fiddle - https://jsfiddle.net/szrqwL9h/ Basically i need to link each navigation item to the dropdown but this needs to be done in a way if more top level categories are added the menu will open for a new category. Any help would be appreciated. i did try $(".MastHead").find("NavDropdown").addClass('open');But didnt seem to work
AJAX: Sync faster than than Async?
You wouldn't think so, but in Chromes Developer Tools Network tab, I can see Async: false returning results faster then Async : true. I want to use Async:true, but is it slower... (and wont lock the browser). These are NOT time intensive calls.. Async avg = 800ms, Sync avg 300ms. I'm running 9 requests simultaneously, because of the 6 simultaneous connects limit, I see 3 are queued when running Async. FYI: jquery-1.6.2 Any explanation why Async:true is slower? I can publish snapshots of the
dropdown selected value is not firing in IE and working in chrome
<script type="text/javascript" src="jquery.js"></script> <script> $(document).live('dblclick', function(event){ var $target = $(event.target); if($target.is('select option:selected',this)){ alert('ok') } }); </script> </head> <body> <select name="select" id="select" size="10"> <option value="one">one</option> <option value="ert">ert</option> </select> //This code is working fine in chrome but not working in IE.I wanted to work this code I am I am double clicking on element only.My
Having Issue on Simple Custom Plugin
Can you please take a look at this demo and let me know why I am not able to pass two different options into my plugin? $.fn.contact = function() { opt1: function() { this.append('<a >Hi</a>'); this.css("color", "red"); return this; }, opt1: function() { this.append('<a >Bye</a>'); this.css("color", "red"); return this; } }; $(".plug-txt").contact({ opt1 }); <div class="container"> <div class="plug-txt"> </div> </div>
advice please: unable to clone a row and dynamically change the second select value when changing the first select
I have dynamically added new row by cloning the last row. The row contains two select picker control. I made another function that dynamically change the value of the second select when changing the first select. This function is not working on the cloned rows. Any idea what I made wrong?? <html> <head> <script type="text/javascript" src="./include/jquery/jquery-1.2.6.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnDel').attr('disabled', 'disabled');
Hellp with Jquery Argument / Statement
I have a custom piece of script that i am trying to modify. The function of this is to display a Pricing Table. One product may have hundreds of pricing tables depending on what attributes are chosen. As it stands, it will only show one at a time and only if attributes are selected. /** * VARIABLE PRODUCT PRICING TABLE */ function rp_wcdpd_switch_variable_pricing_tables(element_id) { jQuery('.rp_wcdpd_pricing_table_variation').hide(); jQuery(element_id).show(); } if (jQuery('.rp_wcdpd_pricing_table_variation').length)
Bend or Wind Effect
I'm hoping someone can help me, I want to apply a dynamics effect, wind to be exact whereas the image sways, left and right; as long as I have control over the pivot for the image, any suggestions, besides GSAP although great library, this it cannot do unless I go the HTML canvas route which is a bit much for this effect.
getting my 1st query to work
Hi, Trying to work out why this query wont work. Some background is that the site is a DNN site with a specific forms module. Its common practice for knowledgeable users to insert jquery but I just cant seem to get mine going. As a starting point, I just want to hide a field & label that sit in their own row. Thanks to a member I have determined that the page is running 1.9.1 Code I have used is (I think the system puts in (jQuery);). Below that is the row that is being referred to. </script> <script
Assign key value pair in each loop
I'm trying to assign key/value variable pairs to an array w/in an each loop, but keep getting undefined on line #6 on the second pass of the loop. My key (mylabel) & value (myvalue) are extracted from form inputs. I'm going to post this to a php file to send out the responses. var arck = 0; $('all my form targets').each(function() { var mylabel = some text; var myvalue = some text; if (arck == 0) {var post_data = new Array(); arck = 1} post_data[mylabel] = myvalue; }); Simple example of
Adding content to an iframe
Hi, Looking at these pen, I'm trying to add content to an iframe. Adding content to an iframe Another example What am I doing wrong? What is the best way to add content to an iframe? Thanks
how to generate dropdownlist dynamically without repeating the selected items in previous fields
Hi i need to avoid already selected option in dynamically generated fields. How to achive this. Please see the image. and updated link https://plnkr.co/edit/aQxytwuYldBzy1dzBQl5?p=preview
jQuery Syntax assistance filter function - wrap element according to condition
Using jQuery version: jquery-1.11.1.min.js I have code that shows or hides elements according to filter.I need help including a condition where if the browser is IE then according to the filter wrap the unmatching elements with a SPAN and hide them, and the other way around - unspan and show. I do not know the syntax and I failed repeatedly. I'm really stuck, please help (if you can by tweaking my code) My Code: <!--This is where I filter the ListBox (select) >> (option) elements via keystrokes -->
Identifying string "No " causing great anquish
Hello. I am trying to hide an associated 'tr' when a value in a child 'td' == "No " in the html the No string is written No For the life of me I can't figure out how to specify this in an if statement so i can hide the row. If you would like, the fiddle is here: https://jsfiddle.net/vhabhsrosed/sj3pxc50/12/ my desperate attempts at code are as follows: HTML <table> <TR><TD width=190 class=ms-formlabel noWrap vAlign=top><NOBR>Request Expedited</NOBR></TD> <TD width=400 class=ms-formbody id=n17WPQ6
Targeting elements except $(this).children(element)
Hello, guys. Here is the code, which i am typing about http://codepen.io/Jacgues/pen/AXakkg As you can see, I ve used to methods to achieve proper funcionality of the menu. The problem is whenever you click Cart position, it doesn't show up. Seems like it is not targeted correctly, so all elements of this kind are "hide()" but no this particular one, which i would like to set as an exception. In case of clicking Account or Help, the toggle() doesn't work. My goal is to acheive toggling the child
jQuery start and stop in asynchronous code
Hi, I was able to stop and restart an animation with the following code. Could someone who has some understanding tell me if this is a good way? I have seen there is a way to pass a variable like “fx” to the queue dequeuer and clearQueue functions. I don’t know how to use it yet; could somebody show an example. I am thinking that it could be helpful here, so I can remove a queue for some time and pick it up later (e.g mouseover). This project has taught me about asynchronous code because it is underneath
Load menu from html file is not working
hi. i`m trying to load a menu from an other html page. (something simple, but it`s not working) My index.html: <script src="js/jquery.js"></script> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <script type="text/javascript"> $(document).ready(function() { $('#navbar').load('nav.html'); });
Checking if a selector and a method combination worked
I want to test if something was successfully appended because I do not know if the selector worked (actually selected anything or even was a valid selector). I read that you can test if a selector worked with if ( $('#someDiv').length ){ } But would this also work for if ( $('#someDiv').append('<p>appended</p>').length ){ } Or do I need to do a plain selection first without a chained function, and then append, as in the first example?
get the value of row before changing in table if cancel click jquery
in my code below i can edit row success without any error but if i need to cancel value edited in row OR get value before changed what i write to cancel edit in row in table by using jquery my code as following @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.js"></script> <script> $(function () { $("#btn").click(function () {
Getting contents of table cell
for(i=0; i<lotteries.length; i++){ document.write("\ \ \ <table id='lot"+[i]+"'><tr>\ \ <td>\ <table border='3'>\ \ <tr> <script language='javascript'> if(lotteries[i][5]=='') {document.write('<td width='+(lotteries[i][3]*7+12)+'
Append after element was created without reload
Hey! I have page. Then I create element like: <div id="element1></div> I need add something to this element without reload page... When I do something like: $(document).on('click', '...', function(){ $('#element1').append('...'); }); This doesn't work ( How I can do this ? pls help...
How to add a drop down menu to my webite
Hello everyone, I'm having trouble adding a drop down menu. After trying for hours to get it to work, I just finally restored my menu to the way it was and decided to ask for help. I can give you more code if needed but here is my HTML for my menu <div class="menu-wrapper"> <div class="menu"> <ul> <li><a href="index.html" class="active">Home</a></li> <li><a href="about.html">About Us</a></li> <li><a href="tutorials.html">Tutorials</a></li> <ul><li><a href="tutorials.html">Testing
Use Ajax Object
I use a ajax in my js file. I want to use responseText to same js file. My code is : var colors = $.ajax({ url: "GetSession.php" }); console.log(colors.responseText); but it wont work! How I use from response text as a variable in the same js file?
no respond when click button to get json data from url in table
I have url www.DevuEgypt.com/api/employees i need to display FirstName,Id,Salary in table by click button using jquery when click button not give me any result and give me two message I try more time but it give me error submit handler has fired this is normal to check error error not found this message show to me my code as below [code] @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.js"></script>
how to remove class from particular rows using jquery
Hi, I want to calculate difference and sum of values of text boxes using jquery following is my code $(".toCalculate1").keyup(function () { var td = $(this).closest('tr').children('td'); var sr = td.eq(1).text(); var total = 0; $(".toCalculate1").each(function (index, item) { temp = parseFloat($(item).val()); if (isNaN(temp)) temp = 0; total = temp - total;
Validate TextBox
Hi I want to Validate TextBox. I want it must have 1 Alphabet . No special Characters & Numeric Digit. Thanks
SEC7112 "blocked due to mime type mismatch" using .ajax post with a jsonp datatype
using jQuery v1.11.3 Problem: trying to post form data with jquery ajax using jsonp. I'm sending json object containing form data to a third party. What comes back in the response is NOT json, rather HTML. I have no control over what is coming back. This is throwing a SEC7112 error. On firefox and some other browers, .always() will fire no problem regardless of SEC7112. But in IE, chrome, the process is halted before .always() can be fired. This applies to .done() and .fail() as well. Anyone
datepicker format
I try datepicker link .. datepicker and i try this code <input ID="fromdate" value="dd/mm/yyyy" runat="server" clientidmode="static" /> but when i try this code <script type="text/javascript"> $(function () { $("#fromdate").datepicker(); $("#todate").datepicker(); }); </script> this show like this where as i also add link s <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"/> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
I cannot add drop down list in table when click edit button for country
I need to display drop down list for country when click edit button in table when click edit button show to me text boxes for id,name,country but i need to show drop down list in place of text box for column country this is my code @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.js"></script> <script> $(function () { $("#btn").click(function
jQuery Accordion with Bootstrap Carousel
I have a jQuery accordion and a bootstrap carousel on the same page. I tried using different versions of jQuery as bootstrap carousel doesn't work with versions less than 1.9.0 or greater than 3.0.0 But None seem to work i.e. I am not able to use jQuery accordion and a bootstrap carousel together. If one works then the other won't work. I would really appreciate if someone could help.
Chrome mobile problem with "animate"!
Hi! I've got a problem only on Chrome Browser MOBILE! The first 2 elements "photo1" and "text1" everythig works fine! Also when i start to scroll, "text2" works fine, the problem is when "photo2" start its own animation; infact when it starts, the browser scroll to top automatically!!! Can you tel me why? Code here >: jQuery(window).load(function () { jQuery('#photo1').css('margin-left', '-350%'); jQuery('.text1').css('margin-right', '-350%'); jQuery('#photo1').animate({marginLeft:'0%'},1000);
Edit table to allow all fields show as text boxes to modify
Hi i have table have two buttons edit and delete i need by jquery make edit to this tables meaning show textboxes inside table to edit the ID,Name,Country my code as following @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.js"></script> <script> $(function () { $("#btn").click(function () { var x = $("#txt1").val();
ONclick on tr
Previously i use link-button in grid-view for when user click on that button then pop up appear.. and this successfully work but now i want when user click on row then pop up .. for link button i use this $(function () {
$('[ID*=lbViewChart]').on('click', function () {
var row = $(this).closest('tr');
var Id = row.find('td')[0].firstChild.data;
var obj = {};
obj.ID = Id;
GetData(obj);
return false;
}); now how i modify in tr?
SEC7127: Redirect was blocked for CORS request. question
here is what i see in my response headers
NetworkError: 414 Request-URI Too Large while inserting png images
Hi when I upload jpg format images It will store in json file. But when i use other than jpg images like png,gif image not store in json file(base 64 format). I have generated jpg images or png in base 64 format but cant insert png images.. I have updated my link https://plnkr.co/edit/6aZiO5L0xuSZ8R3h25GR?p=preview. Please check it,. I have uploaded error screenshot in the above image
Next Page