نمایش پست تنها
  شماره ارسال : [ ]
قدیمی 11-05-2017, 09:30 PM
kenzo
کاربر سایت
kenzo آواتار ها


پست ها
60

+پاسخ ها

تاریخ ثبت نام
Nov 2017

شهر

سیستم عامل

شماره کاربری
13

آفلاین
 
پیش فرض
استایل فرم مرجع
کد:
@font-face{font-family:'Yekan';src:url('../fonts/BYekan.ttf') format('truetype'), url('../fonts/BYekan.eot?#') format('eot'), url('../fonts/BYekan.woff') format('woff');font-style:normal;font-weight:normal;}
@font-face{font-family:'iran';src:url('../fonts/iran.ttf') format('truetype'), url('../fonts/iran.eot?#') format('eot'), url('../fonts/iran.woff') format('woff');font-style:normal;font-weight:normal;}
.body{
	background: url("../images/bg.jpg") no-repeat;
	direction:rtl;
	padding:5px;
}
hr {
       border : 0;
       height : 1px;
       background : #d9d9d9;
       margin : 1em 0;
       }
.form-style-6{
    font: 95% Yekan;
    max-width: 500px;
    margin: 10px auto;
    padding: 16px;
    background: #F7F7F7;
}
.form-style-6 h1{
    background: #6ea000;
    padding: 20px 0;
    font-size: 140%;
    font-weight: 300;
    text-align: center;
    color: #fff;
    margin: -8px -8px 8px -8px;
	border-radius: 3px 3px 0px 0px;
}
.form-style-6 input[type="text"],
.form-style-6 input[type="date"],
.form-style-6 input[type="datetime"],
.form-style-6 input[type="email"],
.form-style-6 input[type="number"],
.form-style-6 input[type="phone"],
.form-style-6 input[type="search"],
.form-style-6 input[type="time"],
.form-style-6 input[type="url"],
.form-style-6 textarea,
.form-style-6 select 
{
    -webkit-transition: all 0.30s ease-in-out;
    -moz-transition: all 0.30s ease-in-out;
    -ms-transition: all 0.30s ease-in-out;
    -o-transition: all 0.30s ease-in-out;
    outline: none;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    background: #fff;
    margin-bottom: 4%;
    border: 1px solid #ccc;
    padding: 3%;
    color: #555;
    font: 95% Yekan;
    text-align: right;
}
.form-style-6 input[type="text"]:focus,
.form-style-6 input[type="date"]:focus,
.form-style-6 input[type="datetime"]:focus,
.form-style-6 input[type="email"]:focus,
.form-style-6 input[type="number"]:focus,
.form-style-6 input[type="search"]:focus,
.form-style-6 input[type="time"]:focus,
.form-style-6 input[type="url"]:focus,
.form-style-6 textarea:focus,
.form-style-6 select:focus
{
    box-shadow: 0 0 5px #6ea000;
    padding: 3%;
    border: 1px solid #6ea000;
}

.form-style-6 input[type="submit"],
.form-style-6 input[type="button"]{
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    padding: 3%;
    background: #6ea000;
    border-bottom: 2px solid #577f00;
    border-top-style: none;
    border-left-style: none;
    border-right-style: none;    
    color: #fff;
}
.form-style-6 input[type="submit"]:hover,
.form-style-6 input[type="button"]:hover{
    background: #577f00;
}
#formmarina label{
	font-size:18px;
}
#formmarina{
	background:#fcfcfc;
	-webkit-box-shadow: 0px 0px 5px 0px rgba(161,161,161,1);
-moz-box-shadow: 0px 0px 5px 0px rgba(161,161,161,1);
box-shadow: 0px 0px 5px 0px rgba(161,161,161,1);
padding:10px;
border-radius:3px;
-webkit-box-shadow: 0px 0px 33px 0px rgba(255,255,255,1);
-moz-box-shadow: 0px 0px 33px 0px rgba(255,255,255,1);
box-shadow: 0px 0px 33px 0px rgba(255,255,255,1);
}

[type="checkbox"]:checked,
[type="checkbox"]:not(:checked) {
    position: absolute;
    right: -9999px;
}
[type="checkbox"]:checked + label,
[type="checkbox"]:not(:checked) + label
{
    position: relative;
    padding-right: 28px;
    cursor: pointer;
    line-height: 20px;
    display: inline-block;
    color: #666;
}
[type="checkbox"]:checked + label:before,
[type="checkbox"]:not(:checked) + label:before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 100%;
    background: #fff;
}
[type="checkbox"]:checked + label:after,
[type="checkbox"]:not(:checked) + label:after {
    content: '';
    width: 12px;
    height: 12px;
    background: #F87DA9;
    position: absolute;
    top: 4px;
    right: 4px;
    border-radius: 100%;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}
[type="checkbox"]:not(:checked) + label:after {
    opacity: 0;
    -webkit-transform: scale(0);
    transform: scale(0);
}
[type="checkbox"]:checked + label:after {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
}
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
    color:    #ccc;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
   color:    #ccc;
   opacity:  1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
   color:    #ccc;
   opacity:  1;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
   color:    #ccc;
}
::-ms-input-placeholder { /* Microsoft Edge */
   color:    #ccc;
}
.mfmverify{
    	background:#fcfcfc;
	-webkit-box-shadow: 0px 0px 5px 0px rgba(161,161,161,1);
-moz-box-shadow: 0px 0px 5px 0px rgba(161,161,161,1);
box-shadow: 0px 0px 5px 0px rgba(161,161,161,1);
padding:10px;
border-radius:3px;
-webkit-box-shadow: 0px 0px 33px 0px rgba(255,255,255,1);
-moz-box-shadow: 0px 0px 33px 0px rgba(255,255,255,1);
box-shadow: 0px 0px 33px 0px rgba(255,255,255,1);
    width: 50%;
    margin-top:40px;
}
@media only screen and (max-width: 500px) {
    .mfmverify{
        width: 90%;
        margin:10px;
    }
}

دایو و کلاس های فرم مرجع :
کد HTML:
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=90%, initial-scale=1, shrink-to-fit=no, maximum-scale=1.0, user-scalable=0">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/boot.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">

<link rel="stylesheet" href="css/style.css" />
<meta charset="utf-8" />
</head>
<body class="body">
<div class="form-style-6" id="formmarina">
<h1>  طراحی سايت مارينا</h1>
<form id="formmarina" action="send.php" method="post" onsubmit='return checkLength();'>
<input type="text" name="name" placeholder="نام و نام خانوادگی" required/>
<input type="email" name="email" placeholder="ایمیل" />
<input type="number" name="code"  onkeypress="return isNumeric(event)" oninput="maxLengthCheck(this)" placeholder="کد انتخابی شما" maxlength = "3"
    min = "100"
    max = "999" required/>
<input type="number" class="textfield" placeholder="شماره تماس: مثال 09121234567" oninput="maxLengthCheck2(this)" id="extra7" maxlength = "11" name="extra7"   required />
<input id='1' type='checkbox' name='chk' value='4000000'  onclick='calculate()' />
	<label for='1'>
400,000 تومان پیش پرداخت
	</label>
	<br />
	<input id='2' type='checkbox' name='chk' value='5000000' onclick='calculate()' />
	<label for='2'>
500,000 تومان هزینه باقیمانده
	</label>
	<p>
	<select id='op1' onchange='calculate()' style='color:#4b6176; '>
	  <option value='0' >-- تعداد زبان سايت --</option>
	  <option value='2000000' >دو زبانه</option>
	  <option value='3500000' >سه زبانه</option>
	</select>
	</p>
	<div style="border:2px dashed #ccc; padding:10px">
	<span style='font-size:18px; color: #666;'>مبلغ قابل پرداخت: </span><br /><label type='text' id='labelmfm' style='font-size:24px; color: #666;'>0</label><span style='font-size:24px; color: #666;'> ریال</span>
	<input type='hidden' value='0' id='example' name='amount' style='font-size:24px' readonly >
	</div>
	<br />
	<center><span style='font-size:14px; font-family:iran'>تمامی هزینه های فوق با احتساب مالیات می باشد.</span></center>
	<input type="submit" value="پرداخت" style='font-size:18px; font-family:yekan' />
</form>
</div>

</body>
<script type="text/javascript">

function calculate() {
var one = document.getElementById("op1").value;
var el, i = 0;
var total = 0;
while(el = document.getElementsByName("chk")[i++]) {
if(el.checked) { total= total + Number(el.value);}
}
mfm= parseInt(total) + parseInt(one);
document.getElementById("example").setAttribute('value', mfm);
document.getElementById("labelmfm").textContent = mfm;
}
function maxLengthCheck(object) {
    if (object.value.length > object.maxLength)
      object.value = object.value.slice(0, object.maxLength)
  }
function maxLengthCheck2(object) {
    if (object.value.length > object.maxLength)
      object.value = object.value.slice(0, object.maxLength)
  }  
function isNumeric (evt) {
    var theEvent = evt || window.event;
    var key = theEvent.keyCode || theEvent.which;
    key = String.fromCharCode (key);
    var regex = /[0-9]|\./;
    if ( !regex.test(key) ) {
      theEvent.returnValue = false;
      if(theEvent.preventDefault) theEvent.preventDefault();
    }
  }
</script>