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

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 the … Read more

[Solved] JQuery script not working at all

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. solved JQuery script not working at all

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

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 is … Read more

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

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, I … Read more

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

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 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

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 solved I want to print only the repeated values … Read more

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

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: none;} … Read more

[Solved] Random HTML Code generated by Javascript?

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” preload=”none” … Read more

[Solved] Changing text by calling javascript

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 solved Changing text by calling javascript