Multiple Datepicker elements format problem
Hi In the following code, element datepicker1 is not initialised as per line 2 of script. But if I move line 1 after line 2, it works. Can someone please explain if this is a bug or intended behaviour. <p>Date: <input type="text" id="datepicker1" name="dp"></p> <p>Date: <input type="text" id="datepicker2" name="dp"></p> <p>Date: <input type="text" ></p> <script> //line 1 $( "input" ).datepicker(); //next line has no effect. However, if move this line after next line, it works.
Using array index to access HTML element grabbed by jQuery selector
jsfiddle here:https://jsfiddle.net/twdLpee6/3/ HTML <span>123</span> <span>abc</span> JS var clear = $('span'); clear[0].html(""); I expect output to be: abc and that '123' is removed. But output I get is: 123 abc THX
How to create function to dynamically created ids
Please I will like to know how to create a function or event listener to check for dynamically created div elements using their ID. I have a dynamically created page which contains fetched content from a jquery ajax backend. What i want to do now is use set interval and refresh the content of the div should incase the content was changed by another user. e.g. <div id= "product1">Content of product 1</div> <div id="product2">Content of product 2</div> but the id is being set from a php backend that
How to show Jquery Datatable Individual column searching (select inputs) at the top of the table header
Dear All, I had the below code where filters are working fine for html table. But I required it to show on top. I had replaced the .appendTo( $(column.footer ()).empty() ) to .appendTo( $(column.header()).empty() ) .But my table headers are going down . I required dropdowns on top my table headers can any one please help me how can I do it. <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Change active hover image src
Can someone please help, cause I don't understand how this cannot work!!??? I am trying to write a small function that would replace a picture src when hovered (see code below) - $(".myimgisthis").hover(function(){ var oldimg = $(".myimgisthis img").attr("src"); var newimg = $(".fiimgi img").attr("src"); $(this).attr("src", newimg); }, function(){ $(this).attr("src", ouimg); }); The reason why I want to use variables and $(this) situations, is because I need this function to work on an PHP output
centre one of multiple inline/floated elements
I already know how to centre things using margin:auto or text-alight:centre. Suppose you have a div which has multiple inline/floated elements. One of these is always present and is called object A. To the left of object A there is always one object. To the right of object A there is a dynamically generated list of other object, there is an unknown number and always at least 1. Is there any easy way to centre object A ether in the centre of the available space (so it is equidistant from both of its
Input text that triggers a switch
Hi I'm writing a html site, and i'm trying to add a jquery input system. I wrote a html page were i divided every word into a class; an class= "A" and a class="B". every class also has a another class attached to it; class="A key1" and a class="B key2". i added a css stylesheet already for the A and B classes. What i want is this: If got a text where every word has a "A key1" and "B key2" class. Default i want the "key1" class to be display:none;. On the top of the page, i want a input box, where
How can I rewrite this with Handlebars.js?
Hi guys, I created the following pen, which is a simple JavaScript to get an API response and output the result: Ajax API with vanilla JS Now, I'm trying to learn Handlebars.js and I need an example with Ajax API with Handlebars.js. Could you please rewrite my example, which is in vanilla JS with Handlebars.js? Thanks
Unable to get the value of input and select control values
Dear All, I had written the below code where I am able to fetch the values of table row expect input control and drop-down-control .Can any one please help me what's wring in my below code. <head> <style> #customers { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; } #customers td, #customers th { border: 1px solid #ddd; padding: 8px; }
Promise alternative
Hi! I'm using promises but have to find a jQuery alternative to make it crossbrowser compatible. How do I have to change that return new Promise(function(resolve)... ? I'm at the very first time getting in contact with promises, no idea how to use a deferred object to get that running.. return ABCREQUEST($.extend(config, { part: params.A }), apiParameter) .then(function (data) { return new Promise(function (resolve) { parseInfo(data, config, function (isOk, responseData) { resolve(itemBuild$(config,
how to set reload button on html or php page?
Hello. I have a set of pages .html and .php which are connected by buttons. Each page contains a return button to go to the previous or x page. I would like that every time I click on return button, the page on which I fall is reload. i am on jQuerry mobile 1.4.5 and I use this code line for my back button: <a href=''../index.html" class="ui-btn ui-icon-back ui-btn-icon-left"> Back </ a > Any help will save me. thanx in advance
JQuery data-table with individual filter / search column
Dear Contributors , I required you all support , Actually I am professional in manual testing and now started working on programming. My client has given me the work to have data-table with filter drop-downs for each column for the below html table using jquery with. Can any one please help me how can I do it. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } #myInput { background-image: url('/css/searchicon.png');
Help pz send pdf file
I can't send pdf to the database index.php <td> <input type="file" id="fileIMG3" name="fileIMG3" accept="application/pdf" > </td sender.php if(!empty($_FILES['fileIMG3']['type'])){ $target_path3 = $_FILES['fileIMG3']['name']; $valid_extensions3 = array('pdf'); $temporary3 = explode(".", $_FILES["fileIMG3"]["name"]); $file_extension3 = end($temporary3); if((($_FILES["fileIMG3"]["type"] == "img/pdf")) && in_array($file_extension3, $valid_extensions3)){ $target_path3
Data filter
Is this code is right? the data filter is not working! //data-filter $(document).ready(function(){ $(".filter-button").click(function(){ var value = $(this).attr('data-filter'); if(value == "all") { //$('.filter').removeClass('hidden'); $('.filter').show('1000'); } else { // $('.filter[filter-item="'+value+'"]').removeClass('hidden'); //
detecting exit-intent caused by back/forward, close tab/browser and url bar
i know that the beforeUnload event can be used to detect when the user is moving off the page. I also know that events which nothing to do with the DOM such as back/forward, close tab/browser and url bar use cannot be detected directly which means the following psudocode is not possible $(window).on('beforeUnload' , function ( e ) { if( event.target = back/forward || close tab/browser || url bar ) { return "please dont leave"; } }); Is there any way to achieve
Check specific checkbox on checkbox click
I have a form that has some questions (email, phone number, etc) and then the user can select for each question through checkboxes if: - that question should be included for the registration types that exist for a conference - and also if that field should be mandatory or not for each registration type. So for example, for the question "Whats your phone number?", if the checkbox "mandatory for the registration type General" is checked the "Include for registration type General" for that same question
jquery parseXML : Properly traverse XML file hierarchically
I have an XML file (below) that I need to parse using jquery "**parseXML**". The goal: Traverse the hierarchy of XML file and loop over the iterations to extract the data. - List in an array of all "mycase" - for each "mycase" iteration, the list in an array of all "testrun" - for each "testrun" iteration, the list in an array of all "router" - for each "router" iteration, the list in an array of all "cmdname" and "cmdfile" Desired outcome: The optimal outcome
Multiple show/hide is not working
Following query is not working properly, particularly hide for component id 5a79817b902c3 : <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> jQuery.noConflict(); (function( $ ) { $(document).ready(function(){ $("#component-5a77eb8fd5f26").show(); $("#component-5a77eb8fedf65").hide(); $("#component-5a77eb8fa0721").hide(); $("#component-5a77eb8f79911").hide(); $("#component-5a7180dae1520").show(); $("#component-5a79817b902c3").hide(); $("#component-5a79817be29b1").hide();
Is it possible to know pixel numbers of non-white area image ?
Hi my friends, I need to estimate leaf area of my samples. I put my leaves on a sheet of A4. Then, take picture to sheet of A4 with leavs vertically. So I need to pixels of plant leaves to estimate leaf area. I have added a sample you can see below. How can I estimate the leaf area by pixel counting method, is it possible to do it with jquery ? Best regards.
Help needed
Hello, I am using thrive architect-builder on my website. Please find the attached screenshot and let me know how to fix it. It's really frustrating, wordpress and plugin all up to date and all other plugins are deactivated, them is 2017... Thank you!
jQuery fails on mobile
My problem is in the following URL: https://www.pcgraph.co.il/product/plastic-card/ Clicking on the envelop icon opens a contact form. Problem is that on mobile when missing some mandatory fields it doesn't popup again as it should(On desktop works fine). The user must click on the envelop icon again in order to launch it. Something is bad with the jQuery code that fails on mobile. Any idea? Thx
How to replace a style attribute?
Assume the web page contains the following code <div style="height: 80px; padding:10px 0;"> .... </div> Now I want to replace the 80px value by a 50px value. How can I achieve this for a) the first occurency and b) for all occurencies? The following does not work: $("div[style='height: 80px;'").css("height","50px");
PROPER EVENT BINDING:
Please somebody help me with this? i don't know what to do? PROPER EVENT BINDING: Consider using the preferred .on() method rather than .click(), .bind(), .hover(), etc. For best performance and concise code use event delegation whenever possible: Here is my code: $(document).ready(function($) { "use strict"; //Initiat WOW JS new WOW().init(); //Smooth Anchor Tag $(document).on('click', 'a[href^="#"]', function (event) { event.preventDefault(); $('html, body').animate({ scrollTop:
How can i get the value from (default value or selected value) in the select box
Dear Expert, Default login name in the Requestor Name(Select box) ,User may select other Requestor Name also I have one Requestor Name(Select box). In this select box i wrote one query like this select username,concat(a.firstname,' ',a.lastname) as Name from dir_user a where active = "1" order by 2. username is like this (yapgt@gmail.com.my.) in my table.based on the above query i am saving username in backend, frontend i am displaying name like this (YAP GEE TIAN ) i kept one JQuery function
Check "rtypecheckbox" checkbox when "mandatorycheckbox" checkbox is checked is not working
I want that when the input with "mandatorycheckbox" class is checked that the input with "rtypecheckbox" be also always checked. Do you know why that is not working with code below? Example: https://jsfiddle.net/7Lz1Lthj/6/ Html: <table class="table table-striped table-responsive-sm"> <thead> <tr> <th scope="col">Info</th> <th scope="col">Include</th> <th scope="col">Mandatory</th> </tr> </thead> <tbody> <tr> <td>Phone number</td> <td> <div
Incorrect display of checkboxes
Hello, why can it be that some checkboxes are displayed incorrectly? Here is an example: http://loefe.de/jq/ I have tried the current v1.12.1 as well as the v1.11.4. In both cases, the lower checkboxes are displayed incorrectly. Tested with Seamonkey and Opera Browser. It seems as the combination of tab with control group and checkbox is causing problems. I hope one of you can help me.
Hello my friends. I'm trying to understand Ajax. Namely, with the sending data to the server. I have the form
Hello my friends. I'm trying to understand Ajax. Namely, with the sending data to the server. I have the form, and i need to send to db with ajax <form id = "send_form"> <table> <thead id=heading> <tr> <th>Name <th>Age <th>Salary </tr> </thead> <tbody id=records <tr> <td> <div class="col-sm-3"><textarea
Textarea do not change with Jquery when I add a text
I need to reset a textarea to its first value with Jquery and Ajax. My script does'nt work when I change the valu in the textarea. Please see my JsFiddle and its explanation : https://jsfiddle.net/peter45/9aq8b18t/ Thank you for your help.
how to add a new column as first column of data table
hi, following is the code, which brings six cols ,i need to add a col as first col in the table then i wiil fill it up with relevent running numbers . <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="Scripts/jquery-3.2.1.js"></script> <link href="Scripts/DataTables-1.10.16/css/jquery.dataTables.css" rel="stylesheet" /> <script src="Scripts/DataTables-1.10.16/js/jquery.dataTables.js"></script> <script type="text/javascript">
Carousel widget works, but not appearing in browser...
I have created a working widget, but I do not know how to instantiate the code to run on the page (it looks great in view source when I save the page). I have tried... // ===== Instantiate Carousel ===== // jQuery("#carousel").carousel(); // ===== Instantiate Carousel ===== // jQuery("#carousel"); neither work, I have read about getting the widget to instantiate, and I have a working tabs widget that uses the first method above (with the words tabs instead of carousel) - but that widget uses JQueryUI
How close does preventdefault() have to be to the source event?
consider the following code var tempEvent; $('a').on('click',function( e ){ e.preventdefault() tempEvent = e; someOtherFunction() }); function someOtherFunction(){ tempEvent.preventdefault() } In this example there are two preventdefault() statements The first (green) one works The second (red) one does not (even if you remove the first) Why is this? is it anything to do with the fact that the event has been stored in a global scope variable? would it make any difference if
Button File Upload Issues - JQueryMobile(does not work) vs HML5(works)
Hello, Newbie Question: HTML - The "Form Action" code shown below lets the user select and upload a file to a database(Works in HTML5-no problems). However... Using JQueryMobile - The code returns "undefined" or should I say opens an "undefined page?" (in this case, the JQuery doc never connects to the upload.php file.) How to I modify the HTML5 code to execute in JQueryMobile? (searched and tried several days of solutions but no success.) IAustin Thank You ----------------------------- version
Intercept browser function based exit
I want to produce a warning you are about to leave popup if the user tried to leave via browser based functions (back, forward, url bar, close tab, close browser ect) but not if they use a page based function ( <a href>, form submit, javascript functions ect ) I have been trying to use code such as $(window).on( 'beforeunload' , function( event ) { if ( someCondition ) { return 'please dont leave'; } }); In place of someCondition i have tried various pieces
Good effect for ecommerce
Goof effects with Jquery for ecommerce? We need a a good ecommerce site but we want to give life with good effects and good transformations
fill input from multiple select
Hi ! I am trying to fill an input type text from a select multiple, but I can get only value from one selected <select multiple="" id="selectGroupIds" name="selectGroupIds" aria-invalid="false"> <option value="">None</option> <option selected="" value="1,2,3">Group 1</option> <option value="4,5,6">Group 2</option> <option value="10,20">Group 3</option> </select> <input type="text" name="jform[user_ids]" id="jform_user_ids" value="" class="inputbox" aria-invalid="false"> <script type="text/javascript">jQuery(function
checkbox validation error
hi guys how do i validate a checkbox, the code below gives errors error message is Uncaught TypeError: "#SaC_Check".is is not a function Ehi $("#SaC").click(function (e) { if (!('#SaC_Check').is(':checked')) { alert("Please click the checkbox to agree to our Terms & Conditions !"); }; });
facing problem in send and recieving the dada between jquery pages
i am not able to send data between jquery pages (one is data accepting page and other is process page )and i am using eclipse oxygen do i need to import jquery through script tag or eclipse supports jquery by default.. and my code goes as follows: data accepted like this: $.cometChat.send($(textInput).val()); data is recieved by process page like this (function($){ $.cometChat = { value:undefined, recieve :function(message) {
Add 3 years to current date
Hi , I am new to JQuery. My requirement is For every 3 years only user can apply for this request For Example Submit request 10/01/2017 ,he can eligible again 11/01/2020 only. Before that he can not submit the request. I am not getting how to add 3 years to current date Could anyone can help me please. Thank You
Edit navigation bar
Hello I am new here and i am new in JQuery. Can anyone help me how can i edit this file to make more steps and do it to work perfectly? main.js jQuery(document).ready(function($){ function ProductBuilder( element ) { this.element = element; this.stepsWrapper = this.element.children('.cd-builder-steps'); this.steps = this.element.find('.builder-step'); //store some specific bulider steps this.models = this.element.find('[data-selection="models"]'); this.summary; this.optionsLists = this.element.find('.options-list');
JS Error after migrate to new server
Hi My website work fine until migrate from a native linux server to a Linux CPanel server. Now show too manies JS errors by JQuery side like this: Uncaught ReferenceError: jQuery is not defined at (index):121 NO JS function work now: menu, carrousel, etc. Howerver, the current NON CPANEL server continue work fine (whitout JS error) Any body know another issue like this for CPanel? Or JQuery have some server specification that fix it? Why one server is right and another wrong (both Centos 7.2 &
Next Page