Jump to content

Makwana Prahlad

  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Makwana Prahlad

  1. Hello,@Niladri Please try this code,To JQuery click event is not working on dynamically created ul Li list in mvc. $("body").on("click", "#btnCreate", function(e) { $.ajax({ type: "Get", url: "/ClientMaster/AddClient", success: function (response) { $("#createContainer").html(response); $('#ModelPopup').modal('show'); setTimeout(function () { $(".btnSave").on("click", function () { var formdata = new FormData($('form').get(0)); var file = document.getElementById("Imagelogo").files[0]; formdata.append("Logo", file); formdata.append("Imagelogo", $("#txtFile").file); formdata.append("ClientName", $("#ClientName").val()); formdata.append("Address", $("#Address").val()); formdata.append("Email", $("#Email").val()); formdata.append("website", $("#website").val()); formdata.append("ContactPerson", $("#ContactPerson").val()); formdata.append("PhoneNumber", $("#PhoneNumber").val()); $.ajax({ url: '/ClientMaster/Create', type: "POST", data: formdata, processData: false, contentType: false, success: function (data) { if (data != 1) { $("#createContainer").html(data); $('#ModelPopup').modal('show'); return; } else { $('#ModelPopup').modal('hide'); $.notify("Client Details Succesfully Added!", { align: "right", verticalAlign: "top", type: "success", background: "#20D67B", color: "#fff", }); Listing(); } }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.error); } }); }); }, 500); } }); }); I hope this code will be useful. Thank you.
  2. Try this line: window = Object.assign(window, { innerWidth: 500 });
  3. Hello,@likecoding Please try this code,To How to return string between special characters public static String innerSubString(String txt, char prefix, char suffix) { if(txt != null && txt.length() > 1) { int start = 0, end = 0; char token; for(int i = 0; i < txt.length(); i++) { token = txt.charAt(i); if(token == prefix) start = i; else if(token == suffix) end = i; } if(start + 1 < end) return txt.substring(start+1, end); } return null; } I hope this code will be useful for you.
  4. try this: <div id="carouselExampleControls" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="carousel-item active"> <img class="d-block w-100" src="..." alt="First slide"> </div> <div class="carousel-item"> <img class="d-block w-100" src="..." alt="Second slide"> </div> <div class="carousel-item"> <img class="d-block w-100" src="..." alt="Third slide"> </div> </div> <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> Add bootstrap link
  5. Hello, @dane Please try this code,To Javascript Tabs not working <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Dynamic Tabs</h2> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#home">Home</a></li> <li><a data-toggle="tab" href="#menu1">Menu 1</a></li> <li><a data-toggle="tab" href="#menu2">Menu 2</a></li> <li><a data-toggle="tab" href="#menu3">Menu 3</a></li> </ul> <div class="tab-content"> <div id="home" class="tab-pane fade in active"> <h3>HOME</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> <div id="menu1" class="tab-pane fade"> <h3>Menu 1</h3> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div> <div id="menu2" class="tab-pane fade"> <h3>Menu 2</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</p> </div> <div id="menu3" class="tab-pane fade"> <h3>Menu 3</h3> <p>Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> </div> </div> </body> </html> I hope this code will be useful for you. Thank You.
  6. First, you need to get the ID of the playlist that represents the uploads from the user/channel: https://developers.google.com/youtube/v3/docs/channels/list#try-it You can specify the username with the forUsername={username} param, or specify mine=true to get your own (you need to authenticate first). Include part=contentDetails to see the playlists. GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=jambrose42&key={YOUR_API_KEY} In the result "relatedPlaylists" will include "likes" and "uploads" playlists. Grab that "upload" playlist ID. Also note the "id" is your channelID for future reference. Next, get a list of videos in that playlist: https://developers.google.com/youtube/v3/docs/playlistItems/list#try-it Just drop in the playlistId! GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=UUpRmvjdu3ixew5ahydZ67uA&key={YOUR_API_KEY}
  7. At first, you need to use a input[type=file] to get a File. <input type=file id=file/> <div id=result></div> And then use FileReader to read file to target format, just like base64, text, buffer. const file = document.getElementById('file').files[0] const result = document.getElementById('result') const reader = new FileReader reader.addEventListener('load', () => { result.innerHTML = reader.result }) reader.readAsText(file, 'UTF-8') See: https://developer.mozilla.org/en-US/docs/Web/API/FileReader
  8. Hello, @gordonisnz Please try this code,To w3css replace text on hover ? HTML Code : <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <div class="involved"><span>share</span> </div> </body> </html> $(document).ready(function(e) { $('.involved').mouseenter(function(){ $(this).find('span').text('Mouse Enter'); }).mouseleave(function(){ $(this).find('span').text('Mouse Leave'); }); }); I hope this code will be useful for you. Thank you
  9. <li><a href="more.html">Overview</a></li> <li><a href="more.html">Small Business</a><ul> <li><a href="more.html">Overview</a></li> <li><a href="more.html">Small Business</a></li> <li class="last"><a href="more.html">Corporate</a></li>
  10. Hello, @Raymond Herrera Please try this code,To how to install jQuary on Linux. Get jQuery up and running in a minute or less: Insert this into your HTML (most commonly in the head, but you can throw it before the end body tag too): <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> Then place a script element after your jQuery one. This would alert 'hello' after the DOM is ready. <script>$(function() { alert('hello') });</script> Using jQuery locally: After you get a feel, try downloading jQuery locally to your computer, and link it from your script file. The structure is like so: C:/web/index.html C:/web/js/jquery.js index.html: <head> <script src="js/jquery.js"></script> <script>$(function() { alert('hi') })</script> </head> You have the advantage of relying on your saved version offline if you don't have the Internet/Wi-Fi. You can also make custom edits to the jQuery source and modify it at will. I hope this code will be useful for you. Thank you.
  11. I'd like my video to start playing automatically when the page is launched without sound just like on this page: [LINK REMOVED]. I've tried any possible jQuery/javascript/CSS option I could find online but I always end up with Google error that's blocking the video from autoplay unless there was an interaction. How did they do it in the link above?
  12. To start MongoDB, run mongod.exe from the Command Prompt navigate to your MongoDB Bin folder and run mongod command, it will start MongoDB main process and The waiting for connections message in the console. If you want to connect mongodb through shell, use below commands For more information follow this link: https://medium.com/stackfame/run-mongodb-as-a-service-in-windows-b0acd3a4b712#:~:text=To start MongoDB%2C run mongod,connections message in the console.
  13. To change the data type of a column in a table, use the following syntax: SQL Server / MS Access: ALTER TABLE table_name ALTER COLUMN column_name datatype; My SQL / Oracle (prior version 10G): ALTER TABLE table_name MODIFY COLUMN column_name datatype; For More information follow this link https://www.w3schools.com/sql/sql_alter.asp
  14. Hello, @vmars316 Please try this code,To Put two tables side by side (on same line) <strong>Using display: inline-block; </strong><br> <table border=1 class="inlineTable"> <tr> <td>Cell content</td> <td>Cell content</td> <td>Cell content</td> </tr> </table> <table border=1 class="inlineTable"> <tr> <td>Cell content</td> <td>Cell content</td> <td>Cell content</td> </tr> </table> <hr> <strong>Using float: left; </strong><br> <table border=1 class="floatedTable"> <tr> <td>Cell content</td> <td>Cell content</td> <td>Cell content</td> </tr> </table> <table border=1 class="floatedTable"> <tr> <td>Cell content</td> <td>Cell content</td> <td>Cell content</td> </tr> </table> //Css File .floatedTable { float:left; } .inlineTable { display: inline-block; } I hope this code will be useful. Thank you.
  15. Use the ampersand & to glue variables together: $url = "http://localhost/main.php?email=$email_address&event_id=$event_id"; // ^ start of vars ^next var
  16. Hello, @Bozaizen Please try this code,To Portfolio gallery with filtering <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } body { background-color: #f1f1f1; padding: 20px; font-family: Arial; } /* Center website */ .main { max-width: 1000px; margin: auto; } h1 { font-size: 50px; word-break: break-all; } .row { margin: 10px -16px; } /* Add padding BETWEEN each column */ .row, .row > .column { padding: 8px; } /* Create three equal columns that floats next to each other */ .column { float: left; width: 33.33%; display: none; /* Hide all elements by default */ } /* Clear floats after rows */ .row:after { content: ""; display: table; clear: both; } /* Content */ .content { background-color: white; padding: 10px; } /* The "show" class is added to the filtered elements */ .show { display: block; } /* Style the buttons */ .btn { border: none; outline: none; padding: 12px 16px; background-color: white; cursor: pointer; } .btn:hover { background-color: #ddd; } .btn.active { background-color: #666; color: white; } </style> </head> <body> <!-- MAIN (Center website) --> <div class="main"> <h1>MYLOGO.COM</h1> <hr> <h2>PORTFOLIO</h2> <div id="myBtnContainer"> <button class="btn active" onclick="filterSelection('all')"> Show all</button> <button class="btn" onclick="filterSelection('nature')"> Nature</button> <button class="btn" onclick="filterSelection('cars')"> Cars</button> <button class="btn" onclick="filterSelection('people')"> People</button> </div> <!-- Portfolio Gallery Grid --> <div class="row"> <div class="column nature"> <div class="content"> <img src="/w3images/mountains.jpg" alt="Mountains" style="width:100%"> <h4>Mountains</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column nature"> <div class="content"> <img src="/w3images/lights.jpg" alt="Lights" style="width:100%"> <h4>Lights</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column nature"> <div class="content"> <img src="/w3images/nature.jpg" alt="Nature" style="width:100%"> <h4>Forest</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column cars"> <div class="content"> <img src="/w3images/cars1.jpg" alt="Car" style="width:100%"> <h4>Retro</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column cars"> <div class="content"> <img src="/w3images/cars2.jpg" alt="Car" style="width:100%"> <h4>Fast</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column cars"> <div class="content"> <img src="/w3images/cars3.jpg" alt="Car" style="width:100%"> <h4>Classic</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column people"> <div class="content"> <img src="/w3images/people1.jpg" alt="Car" style="width:100%"> <h4>Girl</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column people"> <div class="content"> <img src="/w3images/people2.jpg" alt="Car" style="width:100%"> <h4>Man</h4> <p>Lorem ipsum dolor..</p> </div> </div> <div class="column people"> <div class="content"> <img src="/w3images/people3.jpg" alt="Car" style="width:100%"> <h4>Woman</h4> <p>Lorem ipsum dolor..</p> </div> </div> <!-- END GRID --> </div> <!-- END MAIN --> </div> <script> filterSelection("all") function filterSelection(c) { var x, i; x = document.getElementsByClassName("column"); if (c == "all") c = ""; for (i = 0; i < x.length; i++) { w3RemoveClass(x[i], "show"); if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show"); } } function w3AddClass(element, name) { var i, arr1, arr2; arr1 = element.className.split(" "); arr2 = name.split(" "); for (i = 0; i < arr2.length; i++) { if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];} } } function w3RemoveClass(element, name) { var i, arr1, arr2; arr1 = element.className.split(" "); arr2 = name.split(" "); for (i = 0; i < arr2.length; i++) { while (arr1.indexOf(arr2[i]) > -1) { arr1.splice(arr1.indexOf(arr2[i]), 1); } } element.className = arr1.join(" "); } // Add active class to the current button (highlight it) var btnContainer = document.getElementById("myBtnContainer"); var btns = btnContainer.getElementsByClassName("btn"); for (var i = 0; i < btns.length; i++) { btns[i].addEventListener("click", function(){ var current = document.getElementsByClassName("active"); current[0].className = current[0].className.replace(" active", ""); this.className += " active"; }); } </script> </body> </html> I hope this code will be useful. Thank you.
  17. public static Object[] remove(Object[] array, Object element) { if (array.length > 0) { int index = -1; for (int i = 0; i < array.length; i++) { if (array[i].equals(element)) { index = i; break; } } if (index >= 0) { Object[] copy = (Object[]) Array.newInstance(array.getClass() .getComponentType(), array.length - 1); if (copy.length > 0) { System.arraycopy(array, 0, copy, 0, index); System.arraycopy(array, index + 1, copy, index, copy.length - index); } return copy; } } return array; }
  18. Hello,@discount85 Please try this code,To Need help with search bar <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } #myInput { background-image: url('/css/searchicon.png'); background-position: 10px 12px; background-repeat: no-repeat; width: 100%; font-size: 16px; padding: 12px 20px 12px 40px; border: 1px solid #ddd; margin-bottom: 12px; } #myUL { list-style-type: none; padding: 0; margin: 0; } #myUL li a { border: 1px solid #ddd; margin-top: -1px; /* Prevent double borders */ background-color: #f6f6f6; padding: 12px; text-decoration: none; font-size: 18px; color: black; display: block } #myUL li a:hover:not(.header) { background-color: #eee; } </style> </head> <body> <h2>My Phonebook</h2> <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." title="Type in a name"> <ul id="myUL"> <li><a href="#">Adele</a></li> <li><a href="#">Agnes</a></li> <li><a href="#">Billy</a></li> <li><a href="#">Bob</a></li> <li><a href="#">Calvin</a></li> <li><a href="#">Christina</a></li> <li><a href="#">Cindy</a></li> </ul> <script> function myFunction() { var input, filter, ul, li, a, i, txtValue; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); ul = document.getElementById("myUL"); li = ul.getElementsByTagName("li"); for (i = 0; i < li.length; i++) { a = li[i].getElementsByTagName("a")[0]; txtValue = a.textContent || a.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { li[i].style.display = ""; } else { li[i].style.display = "none"; } } } </script> </body> </html> I hope this code will be useful. Thank you.
  19. try this one <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * {box-sizing: border-box} body {font-family: Verdana, sans-serif; margin:0} .mySlides {display: none} img {vertical-align: middle;} /* Slideshow container */ .slideshow-container { max-width: 1000px; position: relative; margin: auto; } /* Next & previous buttons */ .prev, .next { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -22px; color: white; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 3px 3px 0; user-select: none; } /* Position the "next button" to the right */ .next { right: 0; border-radius: 3px 0 0 3px; } /* On hover, add a black background color with a little bit see-through */ .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); } /* Caption text */ .text { color: #f2f2f2; font-size: 15px; padding: 8px 12px; position: absolute; bottom: 8px; width: 100%; text-align: center; } /* Number text (1/3 etc) */ .numbertext { color: #f2f2f2; font-size: 12px; padding: 8px 12px; position: absolute; top: 0; } /* The dots/bullets/indicators */ .dot { cursor: pointer; height: 15px; width: 15px; margin: 0 2px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; } .active, .dot:hover { background-color: #717171; } /* Fading animation */ .fade { -webkit-animation-name: fade; -webkit-animation-duration: 1.5s; animation-name: fade; animation-duration: 1.5s; } @-webkit-keyframes fade { from {opacity: .4} to {opacity: 1} } @keyframes fade { from {opacity: .4} to {opacity: 1} } /* On smaller screens, decrease text size */ @media only screen and (max-width: 300px) { .prev, .next,.text {font-size: 11px} } </style> </head> <body> <div class="slideshow-container"> <div class="mySlides fade"> <div class="numbertext">1 / 3</div> <img src="img_nature_wide.jpg" style="width:100%"> <div class="text">Caption Text</div> </div> <div class="mySlides fade"> <div class="numbertext">2 / 3</div> <img src="img_snow_wide.jpg" style="width:100%"> <div class="text">Caption Two</div> </div> <div class="mySlides fade"> <div class="numbertext">3 / 3</div> <img src="img_mountains_wide.jpg" style="width:100%"> <div class="text">Caption Three</div> </div> <a class="prev" onclick="plusSlides(-1)">&#10094;</a> <a class="next" onclick="plusSlides(1)">&#10095;</a> </div> <br> <div style="text-align:center"> <span class="dot" onclick="currentSlide(1)"></span> <span class="dot" onclick="currentSlide(2)"></span> <span class="dot" onclick="currentSlide(3)"></span> </div> <script> var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; } </script> </body> </html>
  20. The following SQL statement selects all customers with a CustomerName starting with "a": SELECT * FROM Customers WHERE CustomerName LIKE 'a%'; The following SQL statement selects all customers with a CustomerName ending with "a": SELECT * FROM Customers WHERE CustomerName LIKE '%a'; The following SQL statement selects all customers with a CustomerName that have "or" in any position: SELECT * FROM Customers WHERE CustomerName LIKE '%or%'; For more information follow this link https://www.w3schools.com/sql/sql_like.asp Thnak you😇
  21. Hello Please try this query,To How to reset the id in a table The DBCC CHECKIDENT management command is used to reset identity counter. The command syntax is: DBCC CHECKIDENT (table_name [, { NORESEED | { RESEED [, new_reseed_value ]}}]) [ WITH NO_INFOMSGS ] i hope this query will be useful for you. Thank you.
  22. <!DOCTYPE html> <head> <title> How to get selected value in dropdown list using JavaScript? </title> </head> <body> <h1 style="color: green"> GeeksForGeeks </h1> <b> How to get selected value in dropdown list using JavaScript? </b> <p> Select one from the given options: <select id="select1"> <option value="free">Free</option> <option value="basic">Basic</option> <option value="premium">Premium</option> </select> </p> <p> The value of the option selected is: <span class="output"></span> </p> <button onclick="getOption()"> Check option </button> <script type="text/javascript">s function getOption() { selectElement = document.querySelector('#select1'); output = selectElement.options[selectElement.selectedIndex].value; document.querySelector('.output').textContent = output; } </script> </body> </html>
  23. <form> <input type="image" src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQksciuZ2x1A6GVjN9wuG928WoJX79Vuhvu8g&usqp=CAU" alt="Submit" width="48" height="48"> </form>
  24. Hello,@Azimut Please try this code,To Installation npm install upper-case --save Usage import { upperCase, localeUpperCase } from "upper-case"; upperCase("string"); //=> "STRING" localeUpperCase("string", "tr"); //=> "STRİNG" I hope this information will be useful . Thank you.
  • Create New...