Create multidimensional array based on recursive HTML-form
Hi, I am working on an application with some workout exercise. For this I am building a HTML-form which is repeated several times as there are different exercises which needs to be entered. I want to transfer the input into a multidimensional array I can work in PHP before inserting into a database. I found a way through serialize(), but it lists all input out as individual arrays. I can manage this data and set up a function to sort them later in PHP, but I believe there is a better way to structure
[Beginner] - Identify selected form and return hidden input-field value
Hi, I am completly new at jQuery (and javascript in general) and find my self struggling with this: The amount of forms will vary from 0-50+ and is automatically generated through PHP. The forms are pretty much identical, except from they all have a hidden input field which contains a workout id. Once the user hits submit, I want to call a php-function which retrieves all the data from the database and portrays the data in a table in a table/Div-overlay on top of the page. I can do the HTML and PHP
Focus Blur problem
I need to change background color depending on the visibility of dropdown list. Can anyone help? It won't turn to red when I click outside of the menu. https://jsfiddle.net/s86krz1e/ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).on('click','body', function(){ if(jQuery(".selector").is(":focus")){ $("body").css("background-color","green"); } else{ $("body").css("background-color","red");
problem with a switch function
Hi all: I have a function which returns randomly either 6, 7 8 or 9. Then there's a switch function which does different things for each number. Problem is, connecting the random results to the switch function. Currently, Firefox is saying "unreachable code after return statement", but I don't understand how FF's problem with "code after a return statement" applies. Here's the code: function fastLine1() { var poss = [7,7,7,8,8,8,6,9] result = Math.floor(Math.random() * poss.length); return poss[result];
jQuery if statement problem
Hi everyone I am working on my smart home project for college. I am using jQuery to change value of the buttons however it doesn't work as desired Whenever to floors are shown I would like to change the 3rd value (both floors) as well Included code $(document).ready(function() { $("#groundfloor").click(function() { // changing attributes of the buttons if ($(this).text() == "Show ground floor") { $(this).text("Hide ground floor"); } else if ($(this).text()
radio button cheched problem
helo sir i want to tring a quiz app in quiz when i click radio button it checked or when go to next or previous button it show unchecked , i want that when i go next or previos button it show checked . please help my code bellow view_exam.php <?php //view_exam.php include('master/Examination.php'); $exam = new Examination; $exam->user_session_private(); include('header.php'); $exam_id = ''; $exam_status = ''; $remaining_minutes = ''; if(isset($_GET['code'])) { $exam_id = $exam->Get_exam_id($_GET["code"]);
scroll page down when opening blog archive
I'll try my best to explain what I want to do with this. All I want is when opening my blog archive, I want the page to scroll down when I click it open. How to do this? I tried to find an example code, but couldn't. "I can only show you the door. You're the one that has to walk through it." ~ Morpheus The Matrix
search button interference
Hey, I can't seem to unbind my search button with the function I added <script> $(document).ready(function() { $("searchButton").click(function() { $(this).slideToggle(); }); $("searchButton").click(function() { $("searchButton").unbind(); }); }); </script> It is interfering with the function to my blog archive buttons <script> $('button').each(function() { /* "each" in jQuery lets us
problem with archive's post count positioning
Hi. I'm having a problem that has me really stumped. When I click my blog archive open, say on 2020, the post count number next to that (8), will move down. I can show you here in the before/after pics This one is an old pic before the number has been changed. And this is the after pic And here's the related code : #postcount { font-family:Overpass, Georgia, Arial, Verdana; font-size:17px; color:blue; } <li id="postcount"> <!-- this is the start of a year --> <button type="button" class="special">2020</button>
Need help html Form call Web API
html post below is successfully consumed Web API <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <h1>Complex Type</h1> <form id="form1" method="post" action="api/updates/complex" enctype="application/x-www-form-urlencoded"> <div> <label for="status">Status</label> </div> <div> <input name="status" type="text" /> </div> <div> <label for="date">Date</label>
blog archive spacing between the years
Having a problem where the spacing of the years in my archive aren't all the same. The first two are fine, but then as you look down, it increases, then the last two are fine again. How can I fix this? Here's some code : <style type="text/css"> ul { /* These are lists which will have bullet points unless we remove them like this */ list-style-type: none; } li { /* These are the individual list items--the years, the months, the links. We want them to have some space between them to look nicer,
How to display sub total in text box when item and total price add in row?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title> </title> <link href="css/bootstrap-4.0.0.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function() { var id = 1; $("#butsend").click(function() { var newid = id++; $("#table1").append('<tr valign="top" id="'+newid+'">\n\ <td width="100px"
Need help get QueryString Params and print it
Hi, I've html as following, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jQuery: Get QueryString Params</title> </head> <body> <label id="getParams">Print params</label> </body> </html> Let say QueryString abc.html?id=12345 How to apply jQuery read QueryString ---> id=12345 print 12345 in <label id="getParams">Print params</label> Please help
having extra buttons in code
Hey, so I have this CSS code : button:before { /* :before is a "pseudoelement" which lets us put something on the page (before or after an element, in this case, all buttons) using only CSS */ content: "►"; /* This has to be inline-block for the transform below to work */ display: inline-block; color:#000; font-family:Overpass, Georgia, Arial, Verdana; font-size:18px; position:relative; top:0px; left:0px; cursor:pointer; z-index:9999; text-shadow:none; } And am having problems
move item with specific element drag and drop jquery
Chung cư n01 t6 t7 Ngoại Giao Đoàn – Lựa chọn hoàn hảo cho cuộc sống mới! Theo nghiên cứu của những năm gần đây, tại các thành phố lớn như HCM, Hà Nội thì nhu cầu ở chung cư của người dân ngày càng tăng nhanh do sự phát triển của kinh tế xã hội và làn sóng tăng trưởng của người lao động, nhập cư. Vì vậy mà nhiều dự án chung cư ra đời nhằm tạo nên một cuộc sống ổn định cho con người và chung cư n01 t6 t7 ngoại giao đoàn cũng là một trong những lựa chọn hoàn hảo cho cuộc sống mới hiện nay! 3 lý do
Sort Category and subcategory
I have menu with category and sub category. My problem is when I click on a sub category, for example when I click Sub Category B, nothing will be shown. This issue is related to this line: var toSortId = $(this).attr("id"); Which will give us category b and element click. this my jsfiddle
Filter table by multiple user text inputs separated by a comma
Hi,everyone! I'm pretty much a noob here and seek a little help. I have a data table and i've added option to filter out rows matching 4 different criteria. You can see it all in this fiddle: https://jsfiddle.net/billynass/1z7908up/1/ So far it works great,however it works only by entering a single "value" in each input field. What i'd like to add is option to enter multiple column values in the same input field separated by a comma - f.e. in input field "code" i would like to enter "A3,EE" and it
how to get objects from array which is a value of a key in json.
hi, i have to get the value of key ScurvepPlanData from following json, which is an array. then i have to itrate each object. pls tel me how to do it. "ScurvePlanName": "PipeTrack",
"ScurvePlanData": [{
"Levels": "Mechanical",
"Scope": null,
"StartDate": null,
"EndDate": null,
"Weightage": {
"$numberDouble": "20"
},
"ParentLevels": "",
"ActivityId": null,
"IsInternal": false
}, {
"Levels": "Welding",
JavaScript division
Hello there, I'm doing a simple division like this in JavaScript var A = $('#Up').val(); //0.3
var B = $('#Down').val(); //3
var result = A/B; //0.09999999999999999 Windows calculator or calculator on my phone gives me 0.1. So it is doing rounding. Instead of 0.1 why am I'm getting 0.09999999999999999 when I divide 0.3/3? Joe
Jquery Button Not Firing
Okay, I have been playing around with this all day and it just doesn't want to work. <button id="target">click me</button> <script> alert("firing"); $(document).ready(function() { $("#target").click(function() { alert( "Handler for .click() called." ); }); }); </script> The first alert is firing but the alert within the event listener click isn't!
Need help getting data & binding data from Web URL
Hi, I'm a Newbies. I've URL and Data as follow, How my jQuery looks like to binding data into table as follow, <table> <tr> <td>ID</td><td>Name</td><td>Joining Date</td><td>Age</td> </tr> </table> Please help
jQuery slideToggle firing more than once on one click
Hi. I'm having problems where when I click my blog archive's button to open, the first <div> container will slide open then closed then open. This happens 3 times and stops. Does anyone know why? I can share the code as to where the problem may be happening. <script> $(document).ready(function () { $('.myBtn').click(function () { $(".container").add('.container2').slideToggle("slow", function () { if ($(".container2").is(':visible')) $(".myBtn2").addClass('flip');
Get selected id of various anchor class
Hi ,sorry for english, how can i get the id attribute of selected anchor ? https://jsfiddle.net/869pax2f/5/
jQuery newbie with a major problem
Hi all, I just signed in to this forum, and need help please. I'm having a major mix up of my blog archives where I have three of my links that do not show all of my entries when opened. I have some screen shots to show what I am stuck with. It's really weird haha. I hope someone can help. Many thanks for reading. So here is the jQuery side... This opens nicely, but partially, thanks to that red button up there, with the help of the above jQuery. And here are the rest of the entries which should
Getting Text, Values from Select Element as Child of Table
Hello, I have a table of two rows. I'm needing to get the select element's text or values from this table. I've been trying to use a thing that gets the indexed row of the button that fires the event. It is supposed to return the row where the button was fired. I use that as a var in jquery to hopefully get the value of the select element on that row. I'm getting answers in the console, but they are the wrong answers. You will have to load this in VS Code to see what I mean. Thanks [SOURCE] <!DOCTYPE
Need help to modify my jQuery result properly into table
Hi, I'm jQuery Newbies. Can someone help me - Modify my jQuery result properly into table? It should be particular order as following, QR Code Name Age My html Code so far <!DOCTYPE html> <html> <head> <title>Call QR Code Web API using jQuery</title> <meta charset="utf-8" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <table> <tr><td></td><td> <label id="qrcode"></label></td></tr>
Need help to call Web API
Hi, I'm jQuery Newbies. I want to display QR Code in my html Page. Web API URL is - https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Example Parameters is size data Can someone help me to write jQuery in my html Page to call this Web API? Please help
$.load() not working in firefox
Help I have the jquery code below. it works in IE only. I need to know how to make it work in firefox chrome and safary. someone said I have to add -moz, -webkit, -o but I don't know how. any help please. <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body> <div id="stage"> </div> <script> $( "#stage" ).load( "http://127.0.0.1/LoadPageInDiv/list1.html" ); </script> </body>
JSON_Parse() Error from simple array declaration
Hi; I have view several of the other posts relative to json errors but they seem really complicated so...... Here is my test code modified to my elements but taken from the internet: <script type="text/javascript" > var tables = { 'tbl_name' : 'Costs', 'tbl_name' : 'rdata', 'tbl_name' : 'show', 'tbl_name' : 'sqlite_sequence' } // var tables= { "tbl_name":"Costs", "tbl_name":"rdata", "tbl_name":"show", "tbl_name":"sqlite_sequence" }; <== tried this - didn't work alert(JSON.parse(tables));
JQuery append will not add <form name='form1' id='form1' action='my.php' method='post'> dynamically
hi, In my program I want to add a form and list box dynamically. The select and options tags are appended without problem and the list box is created. However, when I try to append the <form> tag it does not happen. Here is the code: <body> <div class=.results> <script type="text/javascript" > function showData(data) { $("div.results").append('<p><b>Choose a Database Table</b></p>'); // $("div.results").append("<form name='tblform' id='tblform' action='' method='post'>"
declaring any attribute in span vs using data-*
hi, i noticed that span can have any custom attribute like xyz <span id="p" xyz="24"></span> now i can use data-xyz also. so my question is which one i should? q2) in first case should i prefer lower case becasue i noticed it takes any thing. yours sincerley
loaded div content not showing or not possible to load into textarea
Hello, i loaded an div id into an <ol> but this is not showing (although it is loading in dreamweaver) So my idea was to load this into an textarea but i did not manage to do. So can someone please help my how to make this content visible? <html> <head> <title>testpage</title> <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> </head> <body> <ol id="flugwetter"></ol> <script> $( "#flugwetter" ).load( "https://www.flugwetter.de/fw/berichte/uebersicht/gaforgeb/get_fw.htm?gebnr=1&
Change tab name on page
Hello, I have searched for some examples and was not able to find any real examples of what I am trying to do. I work for a company that purchased a piece of software that has incorrect names for tabs that open in the software, (not the browser tabs up top) it is web based software. It makes no sense to me, but that is the way it has to be until they patch it. We was told more than a year away. On each page of my workspace I have an input#textfield I want to take the information from this textfield
Returning Data From Function
Hi there, I am trying to return the value of a 'data-value' attribute from a list of checkboxes: HTML: <div id="disableDays"> <div class="field"> <input type="checkbox" id="Sunday" class="is-checkradio" name="Sunday" data-value="0"> <label for="Sunday" class="label">Sunday</label> </div> </div> JQUERY dayValue = $('#disableDays input:checked').each(function() {
Help With Using JS for Accordian CSS in Moodle
Hello, Im new here and would appreciate some help. If im in the wrong forum please let me know. We are a private non profit using Moodle for developing an online training portal for foster and adoptive parents. We found a javascript code that is currently working and is pulling from the jquery website. We need help to be able to download the code and host it on our server because we cannot pull from external sources according to our working guidelines. Here are the code files we are using: https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css
Using external source files and getting started.
Hi, I'm new to using jquery, just a couple of basic starter questions. I found a great example of a rangeslider - I notice the script src points to the code.jquery.com external source locations. Do I need to rely on code.jquery.com being available 100% of the time to use this? Here's the source locations in question: <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
jquery validation custom rule input greather than
Hi Everyone I would like to check if my value in my input is greater than or equal my stock.I check it with my custom rule jquery validator. I had a problem with my code when I enter a value in all my inputs they check, if I decide to change my first input, he no longer wants to check it. He only checks my last input but not the others. This my jsfiddle I think my problems come from my loop, but I'm not sure! Thank you so much for your help. <form id="form_Ajout" name="formulaire"> <table id="TableSelect">
The error "JSON.parse: unexpected character at line 1 column 1 of the JSON data " keep coming up and I don't know how to solve it. Below is my json codes
function load(page) { $.ajax({ type : 'GET', url : page, success : function(data) { try { $('#content').html(data); } catch (err) { alert(err); } } }); } function push(page) { $.ajax({ beforeSend : function() { $('.help-blok').remove(); }, type : 'GET', url : page, success : function(data) { try { console.log('Data has been pushed..'); var res = jQuery.parseJSON(data); if (res.result) { $.each(res, function(key, value) { if (key == 'reload') { load(value); alert('Data saved..'); } }); } else if (res.result
stop watch if the mouse is still
hey I am using Minimal Stopwatch & Countdown App In jQuery - js-timer I modified the code a bit according to my needs When the page loads the counter starts counting : 1- when the mouse is idle for like 5 second i stop time 2-if the mouse is active after 5 seconds the counter triggers or it stopped I am blocked at stage 1 and 2 here is my code https://jsfiddle.net/poeh90tb/
Countdown whit pause and resume
hi , sorry for english , i try to create un countdown with pause and resume , this is my code : https://jsfiddle.net/z0d9w4je/8/ i must to leave the structure as this because some control are doing by php and database...
Next Page