I have a jQuery datepicker on a form and a jQuery slider just below it. When I select the datepicker the calendar pops up, but the button from the slider is visible on top of the calendar.
Is there a way to make sure that the calendar is on top of all other elements on the form?
Here's the page source code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My ASP.NET Web Page</title>
<link href="../Styles/Site.css" rel="stylesheet" />
<link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link type="text/css" href="../css/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
//date picker
$(function () {
$("#classDate").datepicker({ minDate: 0 });
});
//Slider1
$(function() {
$("#slider1").slider({
value:60,
min: 0,
max: 120,
step: 5,
slide: function( event, ui ) {
$("#class1").val(ui.value);
}
});
$("#class1").val($("#slider1").slider("value"));
});
//Slider2
$(function () {
$("#slider2").slider({
value: 6,
min: 1,
max: 12,
step: 1,
slide: function (event, ui) {
$("#class2").val(ui.value);
}
});
$("#class2").val($("#slider2").slider("value"));
});
</script>
</head>
<body>
<div id="page">
<div id="main">
<div id="content">
<form method="post" action="">
<fieldset>
<legend>Sign-up Form</legend>
<ol>
<li class="classDate">
<label for="classDate">Date:</label>
<input type="text" id="classDate" name="classDate" title="Start Date" />
</li>
<li class="class1">
<label for="class1">Slider1:</label>
<input type="text" id="class1" name="class1" title="slider1" style="border:0; color:#f6931f; font-weight:bold;" />
<br/>
<div id="slider1" class="slider" ></div>
</li>
<li class="class2">
<label for="class2">Slider2:</label>
<input type="text" id="class2" name="class2" title="slider2" style="border:0; color:#f6931f; font-weight:bold;" />
<br /><div id="slider2" class="slider" ></div>
</li>
</ol>
<p class="form-actions">
<input type="submit" value="createClass" title="createClass" />
</p>
</fieldset>
</form>
</div>
</div>
</div>
</body>
</html>
Edit:
Still no takers on this, so here's a image to make it clear. The left side shows the normal form; a few boxes and sliders. The right side shows what happens when a user tries to select a date. You can see that the button for the slider is appearing on top of the calendar that pops up.
Add this to your CSS:
.ui-datepicker {z-index:3!important;}
Related
With this input field I can open calendar only on icon next to input field, I want to open calendar on whole input field. How can I do this?
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.2.0/css/datepicker.min.css">
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.2.0/js/bootstrap-datepicker.js"></script>
<script>
function exportbydate() {
swal({
title: "{{trans('a_pdf.choosedate')}}",
html: `<form action="{{ url('/myaccount/view/transfer/pdf') }}" method="GET">`+
`<div class="row">
<input id="fromdate" name="fromdate" class="form-control" type="date" placeholder="Your name here" style="margin:10px; width: 50%;" autocomplete="off" required/>
<input id="todate" name="todate" class="form-control" type="date" style="margin:10px; width: 50%" autocomplete="off" required/>
</div>`+
` <button type="submit" class="btn btn-primary" >{{trans('a_pdf.search')}}</button>`+
`</form>`,
width: '650px',
showCancelButton: false,
showConfirmButton: false,
showCloseButton: true,
})
}
</script>
$( function() {
$( "#datepicker" ).datepicker();
} );
<!-- Using jQuery UI Datepicker -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
</html>
I've been trying to apply iCheck plugins to my radio and check boxes and I just cannot figure out why my radio buttons keep selecting more than a single option, with no experience in JQuery, I think I might need help with this. I used minimal blue skin so I downloaded the blue.css with the blue.png sprite image, jquery-1.11.3.min.js and icheck.js.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="check.js"></script>
<link rel="stylesheet" href="blue.css">
<script>
$(document).ready(function() {
$('input').iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal-blue',
increaseArea: '20%'//optional
});
});
</script>
</head>
<label>
<div class="icheckbox_minimal-blue disabled">
<input type="checkbox" name="quux[1]" disabled>
</div>
Foo
</label>
<label for="baz[1]">Bar</label>
<div class="iradio_minimal-blue checked">
<input type="radio" name="quux[2]" id="baz[1]" checked>
</div>
<label for="baz[2]">Bar</label>
<div class="iradio_minimal-blue">
<input type="radio" name="quux[2]" id="baz[2]">
</div></br>
<body>
</body>
</html>
You have to give same name to all your radio inputs.
<div class="iradio_minimal-blue checked">
<input type="radio" name="quux" id="baz[1]" checked>
</div>
<label for="baz[2]">Bar</label>
<div class="iradio_minimal-blue">
<input type="radio" name="quux" id="baz[2]">
</div></br>
Below is my code for a modal window/page. When I click the submit button, however, I want to navigate to the index.html page. I am however, not able to do that although I have made a form and set the action attribute to the page. I also tried navigating to some other links but it does not work.
I am using jquery.leanModal.min.js which I found online after some searching.
How can I navigate upon clicking the submit button?
<!doctype html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Moi modal page</title>
<link rel="stylesheet" type="text/css" media="all" href="../css/style.css">
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.leanModal.min.js"></script>
</head>
<body>
<div id="topbar"></div>
<div id="w">
<div id="content">
<center>Login to website</center>
</div>
</div>!
<div id="loginmodal" style="display:none;">
<h1>User Login</h1>
<form id="loginform" name="loginform" method="post" action="index.html">
<label for="username">Username:</label>
<input type="text" name="username" id="username" class="txtfield" tabindex="1">
<label for="password">Password:</label>
<input type="password" name="password" id="password" class="txtfield" tabindex="2">
<div class="center"><input type="submit" name="loginbtn" id="loginbtn" class="flatbtn-blu hidemodal" value="Log In" tabindex="3"></div>
</form>
</div>
<script type="text/javascript">
$(function(){
$('#loginform').submit(function(e){
return false;
});
$('#modaltrigger').leanModal({ top: 110, overlay: 0.45, closeButton: ".hidemodal" });
});
</script>
</body>
</html>
Guys I have this html with the following code.It has 2 forms.formA and form B.I have icluded a java script also.I want to make the formB slide down,when I click the link "Internet banking" above form A and when i click on "card payment" vice versa.
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Payment Page</title>
<link rel="stylesheet" href="demo1.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.creditCardValidator.js"></script>
<script type="text/javascript" src="demo.js"></script>
</head>
<body>
this is the javascript I added.
<script type="text/javascript">
$(document).ready(function(){
$("#formA").click(function(){
$("#internet").slideToggle("slow");
});
});
</script>
<div class="demo">
<form id="formA">
Card Payment
Internet banking
<h2>Card Payment</h2>
<input type='hidden' id='ccType' name='ccType' />
<ul class="cards">
<li class="visa">Visa</li>
<li class="visa_electron">Visa Electron</li>
<li class="mastercard">MasterCard</li>
<li class="maestro">Maestro</li>
</ul>
<label for="card_number">Card number</label>
<input type="text" name="card_number" id="card_number">
<div class="vertical">
<label for="expiry_date">Expiry date <small>mm/yy</small>
</label>
<input type="text" name="expiry_date" id="expiry_date" maxlength="5">
<label for="cvv">CVV</label>
<input type="text" name="cvv" id="cvv" maxlength="3">
</div>
<div class="vertical maestro">
<label for="issue_date">Issue date <small>mm/yy</small>
</label>
<input type="text" name="issue_date" id="issue_date" maxlength="5"> <span class="or">or</span>
<label for="issue_number">Issue number</label>
<input type="text" name="issue_number" id="issue_number" maxlength="2">
</div>
<label for="name_on_card">Name On card</label>
<input type="text" name="name_on_card" id="name_on_card">
<input type="submit" value="Pay Now !">
</form>
<form id="formB">
<div id="internet">
Card Payment
Internet banking
<h2>Internet Banking</h2>
<ul class="cards">
<li class="visa">Visa</li>
<li class="visa_electron">Visa Electron</li>
<li class="mastercard">MasterCard</li>
<li class="maestro">Maestro</li>
</ul>
</form>
</div>
</body>
here is the #http://jsfiddle.net/pz83w/5/ demo.Im new to java script,so this is my experiment.Couldsomeone figure how to do this?
You need to modify your function in the following way:
$(document).ready(function(){
$(".tabHeader").click(function(){
$(".form").each(function(){
if ($(this).hasClass('show')) {
$(this).slideUp(400).removeClass('show');
} else {
$(this).delay(400).addClass('show').slideDown();
}
});
});
});
Here is working fiddle - http://jsfiddle.net/pz83w/7/
Remember, since you have two buttons, it's better to use class selector than to use id, same with your forms. That you can add a blank class (like 'show' in the example) to selected item and animate it the way you want.
Fiddle is updated, check HTML section, since I added classes to your forms.
i have a simple Jquery script which allow me to place a nice drop down login box but i have a simple issue with it
when i tried to place more than 1 box lets say 5 the script totally messed
i believe its something regarding the DIV id's and duplication but i don't find a way to resolve this problem
JS code
// Login Form
$(function() {
var button = $('#loginButton');
var box = $('#loginBox');
var form = $('#loginForm');
button.removeAttr('href');
button.mouseup(function(login) {
box.toggle();
button.toggleClass('active');
});
form.mouseup(function() {
return false;
});
$(this).mouseup(function(login) {
if(!($(login.target).parent('#loginButton').length > 0)) {
button.removeClass('active');
box.hide();
}
});
});
html code
<!doctype html>
<html>
<head>
<meta charset="utf8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>jQuery Dropdown Login Freebie | The Finished Box</title>
<link rel="stylesheet" href="css/style.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2"></script>
<script src="js/login.js"></script>
</head>
<body>
<div id="bar">
<div id="container">
<!-- Login Starts Here -->
<div id="loginContainer">
<span>Login</span><em></em>
<div style="clear:both"></div>
<div id="loginBox">
<form id="loginForm">
<fieldset id="body">
<fieldset>
<label for="email">Email Address</label>
<input type="text" name="email" id="email" />
</fieldset>
<fieldset>
<label for="password">Password</label>
<input type="password" name="password" id="password" />
</fieldset>
<input type="submit" id="login" value="Sign in" />
<label for="checkbox"><input type="checkbox" id="checkbox" />Remember me</label>
</fieldset>
<span>Forgot your password?</span>
</form>
</div>
</div>
<!-- Login Ends Here -->
</div>
</div>
</body>
</html>
Yes, Change the ID's and It will work for more than one.