skip to Main Content

How I can get the selected option on element upon change in Jquery?

I have the following select and using Jquery I manage to get the new value so I can process it further: $("select[name=time]").on('change',function(e){ const target = event.target; console.log(target); console.log($(target).val()); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <select name="time" class="container-full"> <option value="12:00" data-payvalue=2300>12:30</option> <option value="13:00" data-payvalue=2301>13:00</option>…

VIEW QUESTION

How do I change the border color of empty fields and prevent a form from submitting? – Jquery

<?php require("../konekcija/konekcija.php"); require("../modeli/korisnik.php"); session_start(); if(isset($_POST["button"])) { $email = $_POST["email"]; $lozinka = $_POST["lozinka"]; $korisnik = new Korisnik(1, "", "", $email, $lozinka); $odgovor = Korisnik::prijava($email, $konekcija); $rez = $odgovor->fetch_array(MYSQLI_ASSOC); $lozinka = $rez["lozinka"] ?? " "; $korisnikID = $rez["korisnikID"] ?? " "; $greska…

VIEW QUESTION

How to call a Javascript method from jQuery

I do have a input type checkbox which has a data attribute on that. data attribute contains a javascript method which need to be executed on click of that textbox. <input type="checkbox" id="id001" data-display="checkDisplayOption(p1,p2,p3);"> Now in jQuery - $("#id001").click(function(){ $("#id001").data("display");…

VIEW QUESTION

How to change the active in pagination? – Jquery

I have a pagination and I want the active class to be in color red. I have this code: script.js: $(".pagination").append("<li class='page-item' id='previous-page'><a class='page-link' href='javascript:void(0)' aria-label=Previous><span aria-hidden=true>&raquo;</span></a></li>"); $(".pagination").append("<li class='current-page active'><a class='page-link' href='javascript:void(0)'>" + 1 + "</a></li>"); for (var i =…

VIEW QUESTION
Back To Top
Search