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
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 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
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
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 !"); }; });
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 &
Resume after preventdefault()
I am using event.preventdefault() to prevent various default events occurring. I Displaying a modal / lightbox window instead. The window has some buttons one of which will allow the event to continue. Is there any way to store the prevented event and run it later? If it helps although the elements which have prevented events are very dynamic i can be certain that the only event which may need to be continued is the last one which was prevented perhaps the event.isDefaultPrevented() can help
jquery autocomplete - adding link to json data
Hi, I am using the following code for jquery autocomplete. Can anyone help me to add links to json data? <script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js"></script> <script> $(document).ready(function(){ $('#country').typeahead({ focus: function(event, ui) { // prevent autocomplete from updating the textbox event.preventDefault(); },
Getting items into cart with info from data-attributes
Hello I'm doing an online shop for the first time so i'm still getting into grasps with this. The first task, which is retrieving the items info and putting them in the cart doesn't work, therefore i cannot check if the other tasks are also working (like price calculation, increase/decrease price and remove cart display when item is there or is not) The articles info is inside a custom data-attribute so i'm trying to retrieve it. I've made a fiddle that you can check below: Shopping Cart Here is
Loading files into folder and read <li> tag content
Hello experts, I'd like to know How I can import list from other files: Files_to_list ├── list_files.html ├── list_1.html ├── list_2.html ├── list_3.html _______________________________ Structure of list_1.html _______________________________ <ul class="list-content"> <li class="article-item"> <div class="text-container"> <div class="article-status"><span class="article-status-label">Publicado</span></div> <div class="article-title">Você costuma sonhar com fantasmas? Você
generating a js object from a string
Hi , I am confused to embed a html string to an element. I used $("#element_id").html(str) But it failed. I also tried to use JSON.parse(str). html object was not formed. How can I generate a js object from following string ? here is the string that returns from my server --- <script type="text/javascript"> (function() { var fn = function() { Bokeh.safely(function() { (function(root) { function embed_document(root) { var docs_json = '{"1744c54a-051b-44c5-b6cf-7b3c3e636e68":{"roots":{"references":[{"attributes":{"bottom_units":"screen","fill_alpha":{"value":0.5},"fill_color":{"value":"lightgrey"},"left_units":"screen","level":"overlay","line_alpha":{"value":1.0},"line_color":{"value":"black"},"line_dash":[4,4],"line_width":{"value":2},"plot":null,"render_mode":"css","right_units":"screen","top_units":"screen"},"id":"e4dd2fda-0b1c-4dd7-b2b9-a37cddce5e71","type":"BoxAnnotation"},{"attributes":{},"id":"8c68f477-291a-482f-a12c-2d62a32d877a","type":"LinearScale"},{"attributes":{"dimension":1,"plot":{"id":"9895c2d7-0571-41c4-ab9d-9924dfe4956a","subtype":"Figure","type":"Plot"},"ticker":{"id":"2d08fb0f-6e17-4b42-9a75-0f2e926ba5b2","type":"BasicTicker"}},"id":"1642bad1-c842-4f20-ad33-40121b0afe9d","type":"Grid"},{"attributes":{"fill_alpha":{"value":0.5},"fill_color":{"field":"yas","transform":"#fb9a99"},"line_color":{"value":"white"},"line_width":{"value":0.5},"xs":{"field":"x"},"ys":{"field":"y"}},"id":"81260da3-6aa6-4f17-aa1a-66d597562647","type":"Patches"},{"attributes":{"formatter":{"id":"56b5109f-3e90-4ae2-afc4-084c1360a9da","type":"BasicTickFormatter"},"plot":{"id":"9895c2d7-0571-41c4-ab9d-9924dfe4956a","subtype":"Figure","type":"Plot"},"ticker":{"id":"c5b3bc3e-1b48-48ca-a776-12b6db20d0e7","type":"BasicTicker"}},"id":"b2109c49-32b2-4047-8147-245c98306311","type":"LinearAxis"},{"attributes":{},"id":"fde2a259-96ce-41db-b50b-4a33ae55e869","type":"LinearScale"},{"attributes":{"active_drag":"auto","active_inspect":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"eaaa30a2-10dc-412b-9182-1a5b82951a25","type":"PanTool"},{"id":"17f6636f-dc45-4edb-b0f4-03501c5d64c0","type":"WheelZoomTool"},{"id":"75b5f942-5c7b-4999-88f0-324adc2ace71","type":"BoxZoomTool"},{"id":"e16efbc8-46c4-4b31-a382-f90701f70b4c","type":"SaveTool"},{"id":"d6c60783-ea44-4c3e-9399-9c98aee89b40","type":"ResetTool"},{"id":"47a157ac-9305-418c-a99e-b47edcbec139","type":"HelpTool"}]},"id":"0bdea79b-5cea-4102-85c6-948468c1868d","type":"Toolbar"},{"attributes":{},"id":"c5b3bc3e-1b48-48ca-a776-12b6db20d0e7","type":"BasicTicker"},{"attributes":{"plot":null,"text":"Jeo
Keypad should automatic open in input text box for tablet/ipad in google chrome browser .
Hi, I am building a website only for iPad/ tablet. in the landing page, we are asking from users to enter a mobile number. but the client wants iPad/tab keypad should be automatic open whenever page will load. can anyone help how it will be open .?? my code is. <input type="number" min="1" max="9999999999" class="form-control" name="mobile_number" id="mobile_number" placeholder="Mobile Number" autofocus> I am testing it in google chrome. Thanks
Unable to get the control value from html table row on button click
Dear All, I had written the below code to get the text input control value from html table row, I am able to get the values of other columns except input control .Can any one tell me what's wrong in it. <!DOCTYPE html> <html> <head> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } tr:nth-child(even) { background-color: #dddddd; } </style> </head> <body> <h2>HTML
Unable to Validate multiple Inputs
I have a simple 5 input boxes where user can select 5 different cities from Autocomplete. I want to Validate if any user is entering same city name more than once or not. And highlight that box with a color. I tried with two input boxes it works fine. For more than two it does not work. https://jsfiddle.net/nkdap5fa/12/ html <html> <input type="text" name="country1" id="country1"/> <input type="text" name="country2" id="country2"/> <input type="text" name="country3" id="country3"/> <input type="text"
How to send post request of content editable elements using ajax
In my project parsing JSON data from controller to ui page.And then modify the required the changes in the UI page .USing Contenteditable attribute i can make the elements to edit.Once the modifications has been done, changes has to be made in MYSQL database.I am trying to send the editable elements using AJAX post request.But request is not happening.Can anybody suggest me how to send request AJAX request am trying to send <script> $(document).ready(function(argument) { $('#save').click(function(){
How to appaend table heading and parsed json data into one row in html table
i am having this code $.each(data1.Grade, function (i, item) { gradetr +="<td>" + item.Grade[i] + "</td>"; }); $('#grade').append(gradetr); HTML CODE: <table border="1px" id="grade" style="width: 700px;"> <tr> <th style="text-align: left;">Grade</th> </tr> <tr> <th style="text-align:
i can't understand the working flow of the following code, can anyone explain me?
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#myInput").on("keyup", function() { var value = $(this).val().toLowerCase(); $("#myTable tr").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); }); </script> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border:
Button click function not working for more then one time
Dear All, I had written the below code to create the element and append to html table ,And it's working for fine for only one time. Can any one please help me for what reason it's working only for 1 time <button onclick="myFunction()">Try it</button> <table id="tblCustomListData" border="1" width="100%" style="overflow-x:auto;"> <thead> <tr class="bgcolorgray"> <th>Sno</th> <th >Current DR</th>
create the input control dynamically and assign the value through variable
Dear All, In my below code , I am able to create the element , But I am willing to assign the value via variable "tempvalue" , Can any one help me in knowing how can I do this <!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript"> var tempvalue="Something"; function myFunction() { var txtHTML = ""; //Create Textbox var textInputBox
Why the below code runs to 'undefined'?
<script> var memberTable; $(document).ready(function(){ memberTable = $('#memberTable').DataTable(); }); function addMemberModal(){ $("#createForm")[0].reset(); $("#createForm").unbind('submit').bind('submit',function(){ var form = $(this); $.ajax({ url : form.attr('action'), type : form.attr('method'), data : form.serializeArray(), //converting form data into array and sending it to the server dataType : 'json', success:function(response){ console.log(response); if(response.success===true){ $(".messages").html('<div
Canvas css filter lost when I use Jcrop
hi guys I am using JCROP to crop images and applying a css filter to it. However when the canvas (image) is cropped, it loses its css, (ie the User chosen filter is lost) However if I call the same function via button click it works, but not with jcrop Here is my code Ehi function CanvasCropCSS() { // THIS IS CSS FILTER FUNCTION $("#canvas").removeClass(); var t = $("#Hidden_Filter").val(); //It gets the value of the applied filter from a hidden field alert(t);
How to display certain select field options based on previous select box selection
I have a form that has four select boxes. How can I set it up so that the selection from box #1 affects what displays in box #2? Then the selection in box #2 affects what options display in box #3 and so forth? Example: Select box #1 options: - Green - Red - Yellow Select box #2 options: - Grapes (only shows up if "Green" is selected) - Watermelon (only shows up if "Green" is selected) - Apples (only shows up if "Red" is selected) - Cherries (only shows up if "Red" is selected) - Bananas (only shows
How delete everything between two special patterns?
Assume a web pages contains a lot of stuff (mosty text). In between the text occasionally something like foobar text [caption ...]......[/caption] sample text behind appears. How can I delete with jquery all occurrencies of [caption ...].....[/caption] including the [caption] and [/caption] patterns? "Foobar text" and "sample text behind" (in the sample above) should NOT be deleted Between [caption ...] and [/caption] other elements could appears which should be deleted as well.
Get the value of the chosen data-class and write to a label ?
hi guys I have a group of 10 images which have the following data class below How do i get the value of the selected data-class and write it to a label ? thanks Ehi $(".classify").click(function () { $('#filter').text('You have chosen a filter'+data("class").val); // #filter is the name of the label to be written // below is my image src <img id="Image1" class=classify data-class="blur" style="width:50px; height:50px;" title="Original" alt="thumb image">
Hello my friends! I continue to study jQuery. I returned to my former example, and I can't understand why I can't display the second photo. #filter_image2. I'm add to DB employee_photo2
$(document).ready(function() { $("#sel1").change(function() { var id = this.options[this.selectedIndex].value; var data = { empid: id }; $("#filter_image").removeAttr("src"); $("#filter_image2").removeAttr("src"); $.ajax({ url: 'getEmployee.php', dataType: "json", data: dataString, cache: false, success: function(employeeData) { if(employeeData) { $("#heading").show(); $("#no_records").hide(); $("#emp_name").text(employeeData.employee_name); $("#emp_age").text(employeeData.employee_age);
popup alert once a day
Hi, I am trying to popup an alert once a day, but it does not work, long time I did not touch jquery, I feel I am lost, thanks, your help is appreciated. Here is what I did : <html> <head> <link rel="stylesheet" href="reveal.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script> <script type="text/javascript" src="jquery.reveal.js"></script> <script type="text/javascript"> $(document).ready(function() { if ( localStorage.getItem('seen')
How can i work with API ?
Hi friends, I'm trying to fetch API using POST method with key ans value. If anyone know please help. thank you
What am i doing wrong? Help
hi everyone what am i doing wrong with my menu? it dont wanna work This is what it looks like after i add the menu this is the code for that part as its a mvc kind off script
Next Page