So i am trying to create a payment form for a custom website.There is only one rule :no JavaScript allowed. Here is my code:
<!DOCTYPE html>
<html>
<style>
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=submit] {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: red;
}
div {
border-radius: 5px;
background-color: lightgrey;
padding: 40px;
}
</style>
<body>
<div class="login-page">
<div class="form">
<form class="login-form">
<fieldset>
<h1>Log in </h1>
<input type="text" placeholder="username" required/>
<input type="password" placeholder="password"required/>
</fieldset>
</form>
<form class="Payment">
<fieldset>
<h1> Payment </h1>
<select>
<option value="Payment on pickup">Payment on pickup</option>
<option value="Bank transfer/deposit">Bank transfer/deposit</option>
<option value="Credit/Debit card">Credit/Debit card</option>
</select>
<div id="mobile_creditcard" style="display: block;">
<select name="cardtype" class="form">
<option value="VISA">VISA</option>
<option value="MasterCard">MasterCard</option>
</select>
<br>Αριθμός κάρτας<br>
<input type="text" name="cardnumber" style="width:80%;" maxlength="20" value="" required>
<tr>
<td height="22" align="right" valign="middle">Expiry Date:</td>
<td colspan="2" align="left">
<SELECT NAME="CCExpiresMonth" >
<OPTION VALUE="" SELECTED>--Month--
<OPTION VALUE="01">January (01)
<OPTION VALUE="02">February (02)
<OPTION VALUE="03">March (03)
<OPTION VALUE="04">April (04)
<OPTION VALUE="05">May (05)
<OPTION VALUE="06">June (06)
<OPTION VALUE="07">July (07)
<OPTION VALUE="08">August (08)
<OPTION VALUE="09">September (09)
<OPTION VALUE="10">October (10)
<OPTION VALUE="11">November (11)
<OPTION VALUE="12">December (12)
</SELECT>
<SELECT NAME="CCExpiresYear">
<OPTION VALUE="" SELECTED>--Year--
<OPTION VALUE="04">2004
<OPTION VALUE="05">2005
<OPTION VALUE="06">2006
<OPTION VALUE="07">2007
<OPTION VALUE="08">2008
<OPTION VALUE="09">2009
<OPTION VALUE="10">2010
<OPTION VALUE="11">2011
<OPTION VALUE="12">2012
<OPTION VALUE="13">2013
<OPTION VALUE="14">2014
<OPTION VALUE="15">2015
</SELECT>
</td>
</tr>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody><tr><td width="50%">
Όνομα κατόχου<br><input type="text" style="width:70%;" name="cardholder" value="" required>
</td><td width="50%">
Τηλέφωνο κατόχου<br><input type="text"style="width:70%;" name="cardholderpho" value="" required>
</td></tr>
</tbody></table>
</div>
</fieldset>
<button type="submit">Submit Payment</button>
</form>
</div>
</div>
</body>
</html>
I have 3 problems and i need help.Firstly i want the submit
button to check if username
andpassword
inputs are not given, and if not to give same message for card info(it works if card info is not given) and even though i used the required attribute it doesnt work.
Second problem i cannot fix is that i want to make the credit/debit card form visible***only if *** the debit/credit card payment option is selected.How can i do that?
And last but not least.How can i make the password to be atleast 5 digits indluding 1 upper case and 1 number??