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.
Related
I have a code that submits form by clicking <input type="submit">, and I want to change my form to submit when label, which is outside of the form, is clicked.
What should I do?
Here's my code:
<div class="join">
<p>Join</p>
<span>Join to access all features of the site!</span>
</div>
<form action="join/joinf" method="POST" class="joinform">
<div class="left">
<p>ID<span class="required"> *required</span></p>
<p>PW<span class="required"> *required</span></p>
</div>
<div class="right">
<p><input type="text" name="id" id="id" required>
<p><input type="password" name="pw" required></p>
</div>
<input type="submit" id="formsub" value="join">
</form>
<label for="formsub"><button>join-label</button></label>
Try using Jquery click element, set id for label .
$('#LabelId').click(function(e) {
e.preventDefault();
$("#formsub").submit();
});
So i'm currently building a set of 3 buttons via forms, and having a weird issue i've never seen before with the following code:
<div class='logout'>
<form action='action.php' method='post'>
<input type='submit' value='H'>
<input type='text' name='mode' value='0' hidden>
</form>
</div>
<div class='Mini'>
<form action='action.php' method='post'>
<input type='submit' value='M'>
<input type='text' name='mode' value='MINI' hidden>
</form>
</div>
<div class='Close'>
<form action='action.php' method='post'>
<input type='submit' value='C'>
<input type='text' name='mode' value='DISPLAY' hidden>
</form>
</div>
in its current state none of the forms are shown, but when the > is dropped from the close form tags they become fully functional
CSS is as follows
.logout{
position:Absolute;
left:90%;
top:0%;
}
.Mini{
position:Absolute;
left:87%;
top:0%;
z-index: 1;
}
.Close{
position:Absolute;
left:-130%;
top:0%;
z-index: 1;
}
Your code working perfect. May be some css of div overwrite your form and make it display:none or hidden. If you remove > it will break some css and html. so you will be able to see all forms.
Here is the code run it and check :
<div class='logout'>
<form action='action.php' method='post'>
<input type='submit' value='H'>
<input type='text' name='mode' value='0' hidden>
</form>
</div>
<div class='Mini'>
<form action='action.php' method='post'>
<input type='submit' value='M'>
<input type='text' name='mode' value='MINI' hidden>
</form>
</div>
<div class='Close'>
<form action='action.php' method='post'>
<input type='submit' value='C'>
<input type='text' name='mode' value='DISPLAY' hidden>
</form>
</div>
As you can see here --> FIDDLE
Your elements show up. I am assuming it's CSS ... There is nothing wrong with your HTML itself. You need to look at your CSS styles and figure out why things aren't displaying. Most likely it's going to be the div -->
<div class='logout'>
That's your issue.
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>'
I have a new login page which is not submitting. :(
If I click the button and the required fields are not entered, it fires me back the errors, but as soon as they're filled and I try to submit it does nothing.
The page is live at https://www.safewise.co.nz/trainwise/login
The code
<form action="login.php" method="post" name="logForm" id="logForm" class="styled_form">
<?php if(isset($redirectURL) && !empty($redirectURL)) { ?><input type="hidden" id="redirect" name="redirect" value="<?php echo $redirectURL; ?>" /><?php } ?>
<div>
<p id="login-title">Login</p>
<input name="userEmail" type="email" class="validate[required]" id="userEmail" placeholder="Email"<?php if(isset($enteredEmail) && !empty($enteredEmail)){echo ' value="'.$enteredEmail.'"';} ?> required /><span class="form_hint">Email Address</span>
<input name="userPwd" type="password" class="validate[required]" placeholder="Password" id="userPwd" required /><span class="form_hint">Password</span>
<div class="login-checkbox"><input type="checkbox" name="remember" id="remember" style="vertical-align:middle;" /> <label for="remember">Remember Me</label></div>
<p><input name="doLogin" type="submit" id="doLogin" value="Continue" class="form-button" /></p>
<div id="forgot"><p>Register</p><p>Forgotten Password?</p>
</div>
</form>
<div id="forgotPass" class="reveal-modal">
<div class="modal-header"><h3>Forgot Password</h3></div>
<div class="modal-body" style="text-align:center;">
<form action="login.php" method="post" name="forgotForm" id="forgotForm" >
<p style="margin-bottom:4px;"><em style="font-size:small;color:#3A3A3A">Enter your email address below to receive your new password.</em></p>
<p><input name="rstEmail" type="text" class="validate[required]" id="rstEmail" placeholder="john#example.com" size="25" /> <input name="doReset" type="submit" id="doReset" value="Reset" class="form-button" /></p>
</form>
</div>
<a class="close-reveal-modal">×</a>
</div>
The weird thing is as soon as I remove this code it works.
<div id="forgotPass" class="reveal-modal">
<div class="modal-header"><h3>Forgot Password</h3></div>
<div class="modal-body" style="text-align:center;">
<form action="login.php" method="post" name="forgotForm" id="forgotForm" >
<p style="margin-bottom:4px;"><em style="font-size:small;color:#3A3A3A">Enter your email address below to receive your new password.</em></p>
<p><input name="rstEmail" type="text" class="validate[required]" id="rstEmail" placeholder="john#example.com" size="25" /> <input name="doReset" type="submit" id="doReset" value="Reset" class="form-button" /></p>
</form>
</div>
<a class="close-reveal-modal">×</a>
</div>
Any suggestions?
Where is that div located in the page? It is incorrect to have a form inside a form. And so your code may work when you remove the div above because you've taken out the second form.
Consider having them as two separate entities instead of nested.
Are these forms nested? You cannot have nested forms. You can have multiple forms in a page, just as long they're not nested.
Here's some ref on it http://www.w3.org/MarkUp/html3/forms.html
I was missing a closing div
<div id="forgot">
<p>Register</p>
<p>Forgotten Password?</p>
Needs a closing div at end
<div id="forgot">
<p>Register</p>
<p>Forgotten Password?</p>
</div>
I have this template where I customized whats on it BUT i got stuck on the contact page where the contact form upon clicking the button clear OR send button nothing happens. I really don't know much about most of the stuff ALL are from research through net but can't get to fix this. Am I missing something here?
Questions I have in mind:
1. Do I need to put something or create in "action"
2. What do I have to put in "href" to clear or send the form to my email?
Or you have a better idea.
<h2 class="p0">Contact Form</h2>
<form id="contact-form" action="#" method="post" enctype="multipart/form-data">
<fieldset>
<label><span class="text-form">Name:</span>
<input name="p1" type="text" />
</label>
<label><span class="text-form">Email:</span>
<input name="p2" type="text" />
</label>
<div class="wrapper">
<div class="text-form">Message:</div>
<textarea></textarea>
</div>
<div class="buttons"> <a class="button-2" href="#">Clear</a> <a class="button-2" href="#">Send</a> </div>
</fieldset>
</form>
Use real buttons, don't just give them a class called buttons.
In action, put down the name of the server file that will process this form, for example action="contact_form.php". If you would like to send an email, put down action="MAILTO:someone#example.com".
<h2 class="p0">Contact Form</h2>
<form id="contact-form" action="MAILTO:someone#example.com" method="post" enctype="multipart/form-data">
<fieldset>
<label><span class="text-form">Name:</span>
<input name="name" type="text" />
</label>
<label><span class="text-form">Email:</span>
<input name="email" type="text" />
</label>
<div class="wrapper">
<div class="text-form">Message:</div>
<textarea name="message"></textarea>
</div>
<div class="buttons">
<input type="button" value="Clear" onclick="document.getElementById('contact-form').reset()"
/>
<input type="submit" value="Send" />
</div>
</fieldset>
</form>