Div Overlapping with datepicker - html

I have 2 divs.
First one is a datepicker div and below it i have a graph.when i try to pick a date, datepicker does not work because of overlapping of these 2 divs. I want to suppress datepicker over graph div.
//here is image
http://tinypic.com/r/1549hlz/8
<div id="cal" name="cal" align="center" style="align: center; float: center; padding- right: 150px;" >
<form name="form" method="post">
<span >From</span> <input type="text" name="date_from" id="date_from" onclick="setSens('date_to', 'max');" readonly="true">
<span >Till</span> <input type="text" name="date_to" id="date_to" onclick="setSens('date_from', 'min');" readonly="true">
<input name="submit" onclick="show6(); update6();" type="submit" id="submit" value="Akım"> <input name="submit" onclick="show6(); update8();" type="submit" id="submit" value="Güç">
</form>
</div>
<div id="graph3" name="graph3" align="center" style="display:none;width:1000px;height: 250px;">Akım-Zaman Grafiği</div><br/><br/><br/>
<script type="text/javascript">
function update6(){
graph drawing.....
}
</script>
<script type="text/javascript">
function update8(){
another graph drawing..... (not important for the case)
}
</script>
<script>
function show6(){
document.getElementById("graph3").style.display = 'block';
document.getElementById("cal").style.display = 'block';
}
</script>

You have not cleared your float.
Put this between both DIV's
<div id="clear" style="clear:both;"></div>
So ...
<div id="cal" name="cal" align="center" style="align: center; float: center; padding- right: 150px;" >
<form name="form" method="post">
<span >From</span> <input type="text" name="date_from" id="date_from" onclick="setSens('date_to', 'max');" readonly="true">
<span >Till</span> <input type="text" name="date_to" id="date_to" onclick="setSens('date_from', 'min');" readonly="true">
<input name="submit" onclick="show6(); update6();" type="submit" id="submit" value="Akım"> <input name="submit" onclick="show6(); update8();" type="submit" id="submit" value="Güç">
</form>
<div id="clear" style="clear:both;"></div>
</div>
<div id="graph3" name="graph3" align="center" style="display:none;width:1000px;height: 250px;">Akım-Zaman Grafiği</div>
<br/><br/><br/>
p.s. No need to state type="text/javascript" is fine. You only need one set of tags for all three scripts.
'<script>
function update6(){
graph drawing.....
}
function update8(){
another graph drawing..... (not important for the case)
}
function show6(){
document.getElementById("graph3").style.display = 'block';
document.getElementById("cal").style.display = 'block';
}
</script>'

Related

Form not displaying on button click

Trying to display a login form which appears after clicking on a button 'Sign In', however the button is not implementing.
Here is what I tried:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#s1").click(function(){
$("form").show();
});
});
</script>
<body>
<form action="f1.py" method="post">
<button id="s1">Sign In</button>
<div>
<label for "lid">ID:</label>
<input type="text" id="logid" required>
</div>
<div>
<label for "psw">Password:</label>
<input type="password" id="psw1" required>
</div>
</form>
</div>
You can try this :
$(document).ready(function()
{
$("#s1").click(function()
{
$("form").toggle(500);
});
});
You didn't hide the form to begin with.
consider this:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#s1").click(function(){
$("form").css('display','block');
});
});
</script>
<body>
<button id="s1">Sign in</button>
<form style="display:none;" action="f1.py" method="post">
<button id="s1">Sign In</button>
<div>
<label for "lid">ID:</label>
<input type="text" id="logid" required>
</div>
<div>
<label for "psw">Password:</label>
<input type="password" id="psw1" required>
</div>
</form>
</body>
EDIT: also as mrmonsieur mentioned in comments your closing body tag was wrong

How to make input box big as text area in html

I have to show the a new quote in the input box. The input box is too small.
<form action="https://twitter.com/intent/tweet" method="get" id=usrform>
<div id="input">
<label for=quote>New Quote will appear</label><br>
<input name="text" id="quote" type="text" value="" multiple="multiple">
</div>
<button id=getquotebtn type=button>Get A New Quote</button>
<button id=twitterbtn type=submit>tweet</button>
</form>
<form action="https://twitter.com/intent/tweet" method="get" id=usrform>
<div id="input">
<label for=quote>New Quote will appear</label><br>
<textarea name="text" id="quote" type="text" value="" cols="5" rows="5">your quote is here</textarea>
</div>
<button id=getquotebtn type=button>Get A New Quote</button>
<button id=twitterbtn type=submit>tweet</button>
</form>
Please use textarea instead of the input type text. This is the good practice
For an input that allows a person to type multiple lines, use <textarea>. You can also define the cols and rows the textarea can have, basically creating new lines at that point
Option 1:
$("document").ready(function(){
$("#getquotebtn").click(function(){
setInput("hello world ") //
})
})
function setInput(val){
//alert()
$("#quote").val(val)
$("#quote").css("width", (val.length * 6) +"px"); //dynamically set the width length of input element
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form action="https://twitter.com/intent/tweet" method="get" id=usrform>
<div id="input">
<label for=quote>New Quote will appear</label><br>
<input name="text" id="quote" type="text" value="" multiple="multiple">
</div>
<button id=getquotebtn type=button>Get A New Quote</button>
<button id=twitterbtn type=submit>tweet</button>
</form>
Option 2:
$("document").ready(function(){
$("#getquotebtn").click(function(){
setInput("hello world")
})
})
function setInput(val){
$ ("#quote").val(val)
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form action="https://twitter.com/intent/tweet" method="get" id=usrform>
<div id="input">
<label for=quote>New Quote will appear</label><br>
<textarea name="text" id="quote" type="text" value="" multiple="multiple"> </textarea>
</div>
<button id=getquotebtn type=button>Get A New Quote</button>
<button id=twitterbtn type=submit>tweet</button>
</form>

Fix header position when scrolling

i want to fix the header so it will be there even if i scrolled down
i tried to use position:fixed
<header style="margin-bottom: 1cm; position: fixed; ">
<div style="float:left;" align="left">Instagram User Explorer</div>
<div align="center">
<form name="contact" id="contact" method="get">
Search : <input type="text" name="keyword" id="keyword"/>
<input type="button" value="search!" name="submit" id="submit"/>
</form>
</div>
</header>
but the textfield and button wnt down i dont know why
and what i want is to be in the same line
<header style="margin-bottom: 1cm;">
<div style="float:left;" align="left">Instagram User Explorer</div>
<div align="center">
<form name="contact" id="contact" method="get">
Search : <input type="text" name="keyword" id="keyword"/>
<input type="button" value="search!" name="submit" id="submit"/>
</form>
</div>
</header>
like this :
how to do it ?
Fiddle is here
you need to do a little more work with css to get that effect, the background is just added for visibility in the fiddle. your body needs a margin that can clear the fixed header as well, as seen in .body class below
.header {
height: 50px;
position:fixed;
width: 100%;
background: #ddd;
top: 0;
}
.body {
margin-top: 70px;
}
<header style="margin-bottom: 1cm;">
<div style="float:left;">Instagram User Explorer</div>
<div style="float:right;">
<form name="contact" id="contact" method="get">
Search : <input type="text" name="keyword" id="keyword"/>
<input type="button" value="search!" name="submit" id="submit"/>
</form>
</div>
</header>

width:50% not working as expected

I'm trying to get the each section 50% width of the screen but the Coupon Code section isn't working. I'm not sure if it is my HTML or CSS? Just edited to add the rest of my HTML!
Example:
HTML
<div class="CartCode cf">
<div class="CouponCode">
<h3>Coupon Code</h3>
<script type="text/javascript">
lang.EnterCouponCode = "Please enter your coupon code.";
</script>
<form onsubmit="return Cart.CheckCouponCode()" action="http://www.glyndebourneshop.com/cart.php" method="post">
<input type="hidden" name="action" value="applycoupon">
<div class="CouponCode">
<p>To pay for this order using a gift certificate, enter the gift certificate code in the box below and click 'Go'.</p>
<input type="text" name="couponcode" id="couponcode" class="Textbox Field100">
<input type="submit" value="Go" class="btn">
</div>
</form>
</div>
<div class="GiftCertificate">
<h3>Redeem Gift Certificate</h3>
<script type="text/javascript">
lang.EnterGiftCertificateCode = "Please enter your gift certificate code.";
</script>
<form onsubmit="return Cart.CheckGiftCertificateCode()" action="http://www.glyndebourneshop.com/cart.php" method="post">
<input type="hidden" name="action" value="applygiftcertificate">
<div class="GiftCertificateCode">
<p>To pay for this order using a gift certificate, enter the gift certificate code in the box below and click 'Go'.</p>
<input type="text" name="giftcertificatecode" id="giftcertificatecode" class="Textbox">
<input type="submit" value="Go" class="btn">
</div>
</form>
</div>
</div>
CSS
.cf:after {
content:"";
display: table;
clear: both;
}
.CartCode .CouponCode, .CartCode .GiftCertificate {
float: left;
width: 50%;
}
You have 2 classes of CouponCode here:
<div class="CouponCode">//1st coupon code
<h3>Coupon Code</h3>
<script type="text/javascript">
lang.EnterCouponCode = "Please enter your coupon code.";
</script>
<form onsubmit="return Cart.CheckCouponCode()" action="http://www.glyndebourneshop.com/cart.php" method="post">
<input type="hidden" name="action" value="applycoupon">
<div class="CouponCode">//here is the 2nd
<p>To pay for this order using a gift certificate, enter the gift certificate code in the box below and click 'Go'.</p>
<input type="text" name="couponcode" id="couponcode" class="Textbox Field100">
<input type="submit" value="Go" class="btn">
</div>
</form>
</div>
Remove the 2nd class ant it should work, like here:
<div class="CouponCode">
<h3>Coupon Code</h3>
<script type="text/javascript">
lang.EnterCouponCode = "Please enter your coupon code.";
</script>
<form onsubmit="return Cart.CheckCouponCode()" action="http://www.glyndebourneshop.com/cart.php" method="post">
<input type="hidden" name="action" value="applycoupon">
<div>
<p>To pay for this order using a gift certificate, enter the gift certificate code in the box below and click 'Go'.</p>
<input type="text" name="couponcode" id="couponcode" class="Textbox Field100">
<input type="submit" value="Go" class="btn">
</div>
</form>
</div>
Here is the example code.

How do I use an image as a submit button?

Can someone help to change this to incorporate an image called BUTTON1.JPG instead of the standard submit button?
<form id='formName' name='formName' onsubmit='redirect();return false;'>
<div class="style7">
<input type='text' id='userInput' name='userInput' value=''>
<input type='submit' name='submit' value='Submit'>
</div>
</form>
Use an image type input:
<input type="image" src="/Button1.jpg" border="0" alt="Submit" />
The full HTML:
<form id='formName' name='formName' onsubmit='redirect();return false;'>
<div class="style7">
<input type='text' id='userInput' name='userInput' value=''>
<input type="image" name="submit" src="https://jekyllcodex.org/uploads/grumpycat.jpg" border="0" alt="Submit" style="width: 50px;" />
</div>
</form>
Why not:
<button type="submit">
<img src="mybutton.jpg" />
</button>
Use CSS :
input[type=submit] {
background:url("BUTTON1.jpg");
}
For HTML :
<input type="submit" value="Login" style="background:url("BUTTON1.jpg");">
Just remove the border and add a background image in css
Example:
$("#form").on('submit', function() {
alert($("#submit-icon").val());
});
#submit-icon {
background-image: url("https://pixabay.com/static/uploads/photo/2016/10/18/21/22/california-1751455__340.jpg"); /* Change url to wanted image */
background-size: cover;
border: none;
width: 32px;
height: 32px;
cursor: pointer;
color: transparent;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="form">
<input type="submit" id="submit-icon" value="test">
</form>
<form id='formName' name='formName' onsubmit='redirect();return false;'>
<div class="style7">
<input type='text' id='userInput' name='userInput' value=''>
<img src="BUTTON1.JPG" onclick="document.forms['formName'].submit();">
</div>
</form>
HTML:
<button type="submit" name="submit" class="button">
<img src="images/free.png" />
</button>
CSS:
.button { }