[Solved] How to pass a variable from a page to other in php

[ad_1] You can store the order number in the session. This way, it will be protected and persisted across pages. When you insert the order in book_order.php, store it in the session: $sql2=mysql_query(….); // inserting if($sql2){ $_SESSION[‘order_id’] = mysql_insert_id(); } Now, in book_order2.php you can retrieve the order ID before you do the insert of … Read more

[Solved] JQuery script not working at all

[ad_1] So the issue here was that I was using the old fashion javascript onchange event with a JQuery script. Apparently the 2 don’t like to play together. As soon as I change it to use a JQuery $(‘#Branch’).on(‘change’, function() { in my document ready script it worked fine. [ad_2] solved JQuery script not working … Read more

[Solved] What would be the outcome of evaluating the following statements? {javascript}

[ad_1] This depends on what Element is and whether getAttribute is defined for it. If so, the question is: what does getAttribute do, if called with the parameter of “src”. For instance, if getAttribute is like this: function MyElement() { var that = this; var getAttribute = function(param) { return that.param; } } and Element … Read more

[Solved] How do I make an image repeatedly show and hide every x seconds?

[ad_1] Taking your question quite literal, I think this is what you want. Image shows for 10s hides for 10s, then shows for 10s and hides for 7s, repeat. function promoFade() { $(‘#promo’).delay(x).fadeOut(150).delay(x).fadeIn(150).delay(x).fadeOut(150).delay(x).fadeIn(150); }; setInterval(“promoFade()”, 0); Added setInterval in case you need to wait for the page to load. There are better ways and personally, … Read more

[Solved] Why is .2 not a valid number for jquery.validate.js? [closed]

[ad_1] jsFiddle Demo You could always implement a small observer to fix the case where a number input starts with . like this: $(‘body’).on(‘blur’,’input[data-val-number]’,function(){ if( this.value[0] == “.” ){ this.value = “0” + this.value; $(this).valid(); } }); 2 [ad_2] solved Why is .2 not a valid number for jquery.validate.js? [closed]

[Solved] I want to print only the repeated values once from an associative array

[ad_1] Use filter and map, with a Set to remove the repeated values: var employee=[{“firstName”:”Zahir”,”lastName”:”Alam”,”Age”:25,”Company”:”Switchme”,”Role”:”Developer”,”Department”:”Tech”,”Head”:{“Id”:3,”Name”:”Sourasis Roy”}},{“firstName”:”Amith”,”lastName”:”Manniken”,”Age”:25,”Company”:”Switchme”,”Role”:”Developer”,”Department”:”Tech”,”Head”:{“Id”:3,”Name”:”Sourasis Roy”}},{“firstName”:”Sourasis”,”lastName”:”Roy”,”Age”:28,”Company”:”Switchme”,”Role”:”CTO”},{“firstName”:”Aditya”,”lastName”:”Mishra”,”Age”:29,”Company”:”Switchme”,”Department”:”Tech”,”Role”:”CEO”},{“firstName”:”Priti”,”lastName”:”Lata”,”Age”:24,”Company”:”Switchme”,”Role”:”HR”},{“firstName”:”Sumita”,”lastName”:”Nath”,”Age”:24,”Company”:”Switchme”,”Role”:”HLA Head”,”Department”:”Crm”},{“firstName”:”Tarini”,”lastName”:”Khanna”,”Age”:22,”Company”:”Switchme”,”Role”:”Content Writer”},{“firstName”:”Abhisek”,”lastName”:”Soni”,”Age”:23,”Company”:”Switchme”,”Role”:”HLA”,”Department”:”Crm”,”Head”:{“Id”:5,”Name”:”Sumita Nath”}},{“firstName”:”Ankit”,”lastName”:”Pump”,”Age”:23,”Company”:”Switchme”,”Role”:”HLA”,”Department”:”Crm”,”Head”:{“Id”:5,”Name”:”Sumita Nath”}},{“firstName”:”Pogo”,”lastName”:”Laal”,”Age”:23,”Company”:”Switchme”,”Role”:”Designer”},{“firstName”:”Sabina”,”lastName”:”Sekh”,”Age”:28,”Company”:”Switchme”,”Role”:”HLA Head”,”Department”:”Crm”},{“firstName”:”Sanjay”,”lastName”:”Poudal”,”Age”:24,”Company”:”Switchme”,”Role”:”HLA Head”,”Department”:”Crm”,”Head”:{“Id”:10,”Name”:”Sabina Sekh”}}]; var repeated = […new Set(employee.map(({ Department }) => Department).filter(Boolean))]; $(“div.all”).text(repeated.join(“, “)); <script src=”https://code.jquery.com/jquery-3.3.1.js”></script> <h3>2. List out all department name </h3> <div class=”all”></div> 7 [ad_2] solved I want to print only the … Read more

[Solved] I want to change display property of this span class [closed]

[ad_1] You can do this in CSS fairly easily. If you place the tool tip span within the video title span, you can set it to display:none and have it change to display: block when the video title is hovered. <span class=”video-title”> Title text here <span class=”tooltip”>Tooltip text here</span> </span> .video-title {position: relative} .tooltip {display: … Read more

[Solved] Random HTML Code generated by Javascript?

[ad_1] What do you mean by random source? If you generate a random string for your source it probably wouldn’t be valid. What I think you want is to have an array of valid sources and select one of those valid sources at random. In which case you would do this: HTML <audio class=”audio-element” controls=”true” … Read more

[Solved] Changing text by calling javascript

[ad_1] What you’re trying to accomplish is probably something like this: HTML <div id=”q1″> <a onClick=”javascript:clickFunction()”>Quotation is by</a> </div> JavaScript clickFunction = function() { document.getElementById(“q1”).innerHTML = “<a href=”http://www.quotationspage.com/quote/1463.html”>Antole France</a>”; } JSFiddle 1 [ad_2] solved Changing text by calling javascript