hide and show objects within same parent DIV
this is the html for my button: <div style="width:100%;"> <div class="lc-local-button-wrap"> <input type="text" id="TextCount" style="width:36px;text-align:center;position:relative;top:2px;margin-right:2px;" value="1" /> <button type="submit" value="{?value?}" class="btn btn-danger lc-buy-button"><i class="fa fa-cart-plus" aria-hidden="true" style="font-weight:bold;font-size:22px;"></i></button> </div> <div class="lc-buy-button-done" style="display:none;text-align:center;">
onclick attribute function inside plugin not working
Hi, I have written a simple form validator. Inside this form there are buttons with onClick="myFunction(1)" attribute. I have defined this function inside my plugin but clicking these buttons giving me error "myFunction is not defined" error. I think click event is looking for this function in outer or global scope but the function is defined inside plugin. Although I have found another solution to search all the button inside plugin and bind to click event to related function which I have tested
Click event doesnt fire - multiple buttons
I reference a js file that will contain some logic when an user clicks a button and there is multiple buttons on the page with the same name. I use alert for testing, but it never fires when clicked. Html: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Smokers | Rullepapir</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
How to insert current timestamp in format DD.MM.YYYY HH:MM:SS ?
How can I insert the current timestamp in format DD.MM.YYYY HH:MM:SS ? Peter
jquery-1.8.0.min.js:2 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecate ...
Hi, I'm using an old copy of jQuery (see subject line) and Chrome ver 59 does not like it (again see the subject line). But this version with its ui components such as ui.core, ui.widget, ui.position, ui.autocomplete as well as jquery-ui-1.8.23.custom.css are widely used in my production applications. Questions: (1) What's a newer and stable jQuery min that I can download and run off my local system? (2) Are these any newer and stable counterparts for these four ui components? Thanks.
making multiple ajax/jsonp requests doesnt seems to work!
I am using the following code to make multiple requests var a1 = makeRequest(config.servers[0]); var a2 = makeRequest(config.servers[0]); var all=[a1,a2]; $.when(all).done(function(results) { console.log(results); }); function makeRequest(server) { return $.ajax({ url: buildUrl(server), type: "GET", dataType: 'jsonp', jsonpCallback: "datasource " }); }Intermittently I am getting the following error! Why? Uncaught TypeError: datasource is not a function
How to call blur event from JS file while writing Qunit test case
I have custom search.JS file and contents in JS file as below: $(document).ready(function () { $("#number_c").blur(function(){ toggle($("#number_c"),[$("#number_a"),$("#number_b")]); }); function toggle(input1, inputs) { if (input1.val() != '' ) { for (var i = 0; i < inputs.length; i++ ) { input = inputs[i]; input.val(''); input.prop("disabled",true); } } else { for (var i = 0; i < inputs.length; i++ ) { input = inputs[i]; input.removeAttr("disabled"); } } } }); I need to write Qunit test case
Slide show messing up my slide up?
So I tried my hand at adding a slide show using jquery to the site, but it doesnt seem to be working and now my slide up wont work because of it. Html <h1> Tylers Work</h1> <h2 id="caption">How it all got started</h2> <img id="slide" src="TylerPic.jpg" alt=""> <div id="slides"> <img src="logo1.jpg" alt="Logo 1"> <img src="logo2.png" alt="Logo 2"> <img src="logo3.png" alt="Logo 3"> </div>Css: img{ height: 250px; } #slides img{ display: none; }jQuery //Slide up and down button
[jQuery - blockUI] Help centering block message or finding better Plugin(s)
I started using jQuery BlockUI Plugin by Malsup: http://malsup.com/jquery/block/ I find it useful to simulate "synchronous" Ajax calls and wait for them to complete, while temporarily disabling the user interface(s). I choose this plugin mainly because of its element-blocking functionality (not only window-blocking!). Btw, i started to experience some message-centering problems, in particular when using in combination with jQuery-ui Tabs ... The issue is reported here: https://github.com/malsup/blockui/issues/138
Display JSON Object in Drop Down List
Suppose my AJAX call brings back the following json objects from the backend: [{"FName":"Jane","LName":"Doe", "ID":"ABC123"}, {"FName":"Joe","LName":"Bloe", "ID":"XYZ456"}] Below is my AJAX call but I have not been able to display the JSON contents in a drop down list. var custNames= $("#Customers"); //Drop Down List ID $.ajax({ url: 'http://localhost:32388/api/service', type: 'GET', dataType: 'json', contentType: 'application/json; charset=utf-8',
Responsive design and table click & touch events
Hi there, I planned to make a responsive web site, reachable with smarth phones, tablets and desktop computers. As I'm already familiar with jQuery I decided to add also jQ mobile and solve this problem because jQm looks nice, easy to implement... but I faced myself with input devices events; one of my project pages has a HTML tables with many columns (more than 12) and I planned to implement doubletap and press&hold onto table cell in order to call different dialogs or functions... but it fails!
Jquery searching array and going to page after button is clicked
So I have not started writing the code for this yet. I am just kind of planning everything out before I start, but I wanted to see if this was possible. So basically I'm making a project where people can go to a website and hire people for work. House work, yard work, stuff like that. So I want to have an option that if someone was referred to the website that they could just enter the workers name, and after they got search it would take them to that workers page. So if I had all the workers in
[jQuery] Form Plugins file upload with return json issue in IE
I am using jQuery Form Plugins (v3.51) to upload a file that contains a list of user ids. The Java servlet will retrieve the corresponding user objects and return them in json format. The code works in Chrome. For IE (v11), there is no issue in uploading the file to server. But after writing json object back, the client side does not get json object as expected. Instead, the data is string of html code for whole page. Are there any special settings in server side I am missing? Thanks a lot in advance.
Slicknav menu causing conflict on Joomla site
Hello, I'm really hoping I can try to resolve this issue. I've had it before but managed to juggle things and get them working in various ways, but now I'm really stuck. I have used Slicknav on all my 25 joomla sites and I'm worried these will break too if I update them. I just updated one site to the latest Joomla and also all the extensions, which is Ignite gallery, stopped working with error message about jquery being loaded twice. This is because I'm loading jquery in my template, as per the
Trying to change CSS of pseudoclass adding a class
Dear experts, I'm a jQuery and css beginner and I'm trying to learn it by doing. Now I have a problem, which I'm not able to solve so any help would be very appreciated. As I looked for a solution for changing css with jquery adressing a pseudo element I found this article: https://forum.jquery.com/topic/changing-css-of-after-pseudoclass . I tried to transfer this solution to my following code, but with no success (and please be not too hard with me, I'm really a beginner ;-) ): CSS: nav.main-nav
Swap an element with another element
Hello friends, i am new to jquery and i am trying to swap or move an element with another element, but it's not working completely. I have following html: <div id=content> <div class=c1> <a href="link1"><img src="" alt=""></a> <h2>Headline 1</h2> <p>...</p> <p>...</p> </div> <div class=c2> <a href="link2"><img src="" alt=""></a> <h2>Headline 2</h2> <p>...</p> <p>...</p> </div> <div class=c3> <a href="link3"><img src="" alt=""></a> <h2>Headline 3</h2> <p>...</p> <p>...</p> </div> </div> And I want
How to preview values of dynamically generated fields in rows of a table-include a row for data returned from database
I'm trying to build a form on my website where users can make orders. More fields can be generated dynamically for more orders and a table is displayed previewing the orders so far. However, i intend to incorporate a functionality where costs (and then maybe the total cost too) of each product ordered is displayed on a td on each row of the preview table along with the product and the quantities ordered. I have a php page which echoes the cost of each product as selected from database, and then fetch
selecting all span elements in frameset with id x
This should be easy but it is confusing me. I want all span text to be 0.0 when the onchange event is called. there is another event that sets the individual ids to the correct data and that works fine. but i need to select all spans to 0.0 first. // here is the js code (called onchange of a field) $("#scoreinfo ~ span").text("0.0"); // here is the form code sample <fieldset id="scoreinfo"> <fieldset id="extinfo"> <legend><h2>Vehicle Exterior</h2></legend> <fieldset
datepicker setting minDate in multiple pairs of fields.
I have a page which uses multiple pairs of fields I'm trying to set the minimum value of the to field based on the selection in the from field. <div class="ranges" id="one "><input type="text" class="from"><input type="text" class="to"></div> <div class="ranges" id="two "><input type="text" class="from"><input type="text" class="to"></div> <div class="ranges" id="three"><input type="text" class="from"><input type="text" class="to"></div> <div class="ranges" id="four "><input type="text" class="from"><input
Slider won't stop sliding by hover on a slide
Here is the probelm: http://www.cardoholdings.com/www.cardoholdings.com/?page_id=119 Than go to "Team" Menu item I want to stop the slider progress by hover on a slide. Can someone do that? Thx
Why I am getting 'Access-Control-Allow-Origin' when I run locally???
I am making the following request $.ajax({ url: "http://localhost:8181/data/status", type: "GET", success: function(response) { console.log(response); }, error: function(xhr, error){ console.debug(xhr); console.debug(error); } }) and unexpectedly getting the following response. XMLHttpRequest cannot load http://localhost:8181/data/status. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080'
select on change not working for all selects
Here is all the code for the page. CSS, HTML and JQUERY. The last thing in jquery section is what isn't working properly. Any suggestions would be great. DIV.ui-datepicker {FONT-SIZE: 10px} div.week {DISPLAY: none} DIV.year {DISPLAY: none} DIV.quarter {DISPLAY: none} DIV.presets {DISPLAY: none} DIV.daily {DISPLAY: none} DIV#debug {POSITION: absolute; LEFT: 50px; TOP: 2px} DIV.ranges {BORDER: 3px ridge lightgrey; HEIGHT: 190px; WIDTH: 535px; TEXT-ALIGN: center;} DIV#one {POSITION: absolute; PADDING-BOTTOM:
How to resize the parent div together with the child collapsible div?
I have a parent div used to make my child panel resizable and draggable. Now I wanted to do the panel collapsible. But when it collapses the parent panel should disappear too ... but it is not working. You can see the demo I made here (please see, adding a panel and trying minimize): https://codepen.io/AlamBique/pen/LLqddr/?editors=1010 How to collapse the parent div together with the body-panel? And why the .panel-body (using height: 100%) extrapolates the height of the parent div?
Add pagination to a Table in a sucess function
I am using ajax options with a target Id on a table. Now I need to add Pagination to the table See the code below. I need to add pagination so when the target.append renders, it renders with pagination. select: function (event, ui) { $.ajax({ cache: false, async: false, type: "GET", url: "@(Url.Action("Test", "TesPage"))", dataType: 'json', data: { "id": ui.item.Id }, success:
How to preview values of dynamically generated fields in rows of a table
I desperately need some guidance in solving this, please. I have a form on my website where users fill an input field and selects from a drop down. For more options, a button is provided to generate more fields dynamically for users. That works fine. Now, I’m trying to implement a functionality that previews the orders made by users (in a table format) immediately the user finish filling the orders field and the name field receives focus. With what i've done so far I'm having all the values displayed
having weird troubles with jQuery Autocomplete --
Hello friends. Let me describe what this is about and what i've done so far. As expected, I have a text box where the user would type in names of cities. And it is supposed to show an autosuggest/autocomplete prompt of city names that may match with the letters being typed. I have my server side code returning these city names. 1. my html is simple and such -- Search by City: <input type="text" placeholder="type city name here ..." id="reg_city" style="border-radius: 6px;color:
Slider Redesign Suggestion or new widget
Hello, I am creating an app using jquery mobile. I wanted to use the slider. BUT, when using Chrome on Android and you move the slider VERT slowly, the browser will open a popup with the options: Open in new tab Copy Link address etc My suggestion is adding a [-] sign on the left and a [+] sign to the right, so that if you want to move the slider one at a time you could use those buttons instead of the slider. OR create a new widget [-] XX [+] where XX is the current value Thank you
Help, pagecontainerbeforeshow not fired!
Hi, I am very new to jQuery and Javascript. Recently I am learning from one jQuery Book. There is an example in the book which is about to use 'pagecontainerbeforeshow' to get content from json files and show them on a new page. I have tried this example on my env, but failed. The code piece as follows: <div data-role="page" id="homepage"> <div data-role="header"> <h1>Dynamic Pages</h1> </div> <div role="main" class="ui-content"> <ul id="peopleList" data-role="listview"
Slideup div to display
Hi, I can't seem to work this out despite crawling the web and trying different things, I'm trying to create 4 boxes that would slide up (previously hidden) to display content in this div followed in succession when the page loads. I want them to stay open so I don't need a close feature. Would appreciate someone's help. Cheers
Dynamic variable names and values
Hi, I have my variables in my database fields var_name and var_value is it possible when doing $.each to create the variables and assign its values, something like this: -------- -------- -------- my.[[[var_name]]] = [[[var_value]]] -------- -------- -------- Thanks, Jassim
want to unwrap html using jquery/javascript
I want to unwrap below html using jquery or javscript. for wrap i used below code but on few pages I want to unwrap that part. $('.ms-rte-embedcode.ms-rte-embedwp') .wrap('<div class="container"><div class="row"><div class="col-xs-12"/></div></div>'); Now I want to unwrap parent div's of class "ms-rte-embedcode ms-rte-embedwp". Html: <div class="container"> <div class="row"> <div class="col-xs-12"/> <div class="ms-rte-embedcode ms-rte-embedwp"> Test</> </div> </div> Thanks.
QUnit and benchmarking
I was wandering if QUnit has some sort of benchmarking of each test that is run, and, if not, can this functionality be developed into QUnit?
Datepicker change months and years options appears only hover
I am using the DatePicker JQuery UI. I need the functionality to change months and years, but the combos with the options are in trouble. You need to hover over the desired option so that your name appears. I do not understand why this happens. Can someone help me?
Insecure Randomness and Code Injection on 1.10.2 version
Our team is using the jquery library version 1.10.2 for our jquery needs for the internal site. During our recent Fortify security scan, we found various vulnerability like the Insecure Randomness and Code Injection. I am attaching the screen shots of this vulnerability. Can you please give your feedback
How to compare multiple radio button's value with string?
I'm wondering how to get the multiple selected radio button's value and compare with string? If people click more than one radio buttons, then show all the text that compare with the radio's value. I can now show the text that compare with only one radio button's value, but if I click more than one radio buttons, it still shows the text that I select at first time. For example, in this case: JSFiddle If I click "apple", it shows "apple apple" that's correct, but if I click more than one buttons
Problems after 2nd autocomplete script
Hy @ all Im not good in php, html,... but i got a little page to work for me and my colleges. It takes me some time to get autocomplete to work but finally i was happy. Then i insert the script-part a second time (yes its not a fine way) and changed the necessary parts and also the second autocomplete worked fine. BUT since that time umlauts (ä,ü,ö...) are displayed wrong (ö = ö) if i remove the second script everything is normal again. if somebody has any idea i would be graceful. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
done or success for $.each
Hi, Why I am getting: Error: 'Uncaught TypeError: $.each(...).promise is not a function', line 132, file 'http://localhost:53470/views/signin.js'. $.each(data, function (index, item) { -------- run some code here ------------- ------------ }).promise().done(function () { alert("All was done"); }); Isn't there any done or success for the $.each? kindly advise how to achieve done or success for $.each Thanks, Jassim
how to find all elements with an attr in jquery?
I found this example but it specifically searches all inputs as opposed to all elements: https://api.jquery.com/attribute-equals-selector/ How can I update this example to search *all* elements in the DOM, not just inputs for those that contain a particular attribute like "myAttribute"?
How to select input type "tel" using jquery by id..??
In my form, I have an input field of type="tel". <input type="tel" name="jform[work_phone]" class="validate-phone" id="jform_work_phone " value="" size="30"> I am setting value to this field using jQuery by jQuery("#jform_work_phone").val("123456"); It is not setting the value. What am I doing wrong..??
How to have 2 sliding panels open on screen?
Hi, I am trying to have 2 sliding panels open (one on the left side, the other on the right side) at the same time. Reading the documentation it said, it is possible to open them programmatically. Say that I have the following 2 panels: <div data-role="panel" id="panQuery" data-position-fixed="true" data-theme="none" data-display="overlay" class="transl_panel w33pct" data-dismissible="false" data-rel="close"></div> <div data-role="panel" id="panMap" data-position="right" data-theme="none" data-display="overlay"
Next Page