ఎలా సృష్టించాలి: నమోదు ఫారమ్

CSS ద్వారా ప్రతిస్పందకమైన నమోదు ఫారమ్ ఎలా సృష్టించాలి నేర్చుకోండి.

బటన్ నొక్కడం ద్వారా నమోదు ఫారమ్ తెరుస్తుంది:

亲自试一试

నమోదు ఫారమ్ ఎలా సృష్టించాలి

మొదటి చర్య - HTML జోడించండి:

ఇన్పుట్ నిర్వహించడానికి <form> ఎలమెంట్ ఉపయోగించండి. మా PHP శిక్షణలో మరింత సమాచారం కలిగి ఉంటుంది.

ప్రతి ఫీల్డ్ కు ఇన్పుట్ కంట్రోల్ జోడించండి (అనురూప టాగ్లు తో):

<form action="action_page.php" style="border:1px solid #ccc">
  <div class="container">
    <h1>రిజిస్టర్ చేయండి</h1>
    <p>ఒక ఖాతా సృష్టించడానికి ఈ ఫారమ్ ను పూరించండి.</p>
    <hr>
    <label for="email"><b>ఇమెయిల్</b></label>
    <input type="text" placeholder="ఇమెయిల్ ప్రవేశం చేయండి" name="email" required>
    <label for="psw"><b>పాస్వర్డ్</b></label>
    <input type="password" placeholder="పాస్వర్డ్ ప్రవేశం చేయండి" name="psw" required>
    <label for="psw-repeat"><b>పునఃప్రవేశం చేయండి</b></label>
    <input type="password" placeholder="పునఃప్రవేశం చేయండి" name="psw-repeat" required>
    <label>
    <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px">నాకు గుర్తుంచుకోండి
    </label>
    <p>ఒక ఖాతా సృష్టించడం ద్వారా మీరు మా <a href="#" style="color:dodgerblue">నిబంధనలు & గోప్యతా విధానాన్ని</a> అంగీకరిస్తున్నారు.</p>
    <div class="clearfix">
      <button type="button" class="cancelbtn">రద్దు</button>
      <button type="submit" class="signupbtn">నమోదు చేయండి</button>
    </div>
  </div>
</form>

दूसरा - CSS जोड़ें:

* {box-sizing: border-box}
/* పూర్తి వెడల్పు ఇన్పుట్ ఫీల్డ్ */
  input[type=text], input[type=password] {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  display: inline-block;
  border: none;
  background: #f1f1f1;
}
input[type=text]:focus, input[type=password]:focus {
  background-color: #ddd;
  outline: none;
}
hr {
  border: 1px solid #f1f1f1;
  margin-bottom: 25px;
}
/* सभी बटन के लिए शैली सेट करें */
button {
  background-color: #04AA6D;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
  opacity: 0.9;
}
button:hover {
  opacity:1;
}
/* रद्द बटन के अतिरिक्त शैली सेट करें */
.cancelbtn {
  padding: 14px 20px;
  background-color: #f44336;
}
/* రద్దు మరియు నమోదు బటన్లు సమాంతరంగా ఫ్లోట్ మరియు సమాంతరంగా జోడించండి */
.cancelbtn, .signupbtn {
  float: left;
  width: 50%;
}
/* కంటైనర్ ఎలమెంట్కు అంతర్గత కిన్నర్ మొదటి జోడించండి */
.container {
  padding: 16px;
}
/* ఫ్లాటర్ కలుపు */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}
/* చిన్న స్క్రీన్ పై రద్దు బటన్లు మరియు రిజిస్టర్ బటన్ల శైలిని మార్చండి */
@media screen and (max-width: 300px) {
  .cancelbtn, .signupbtn {
    width: 100%;
  }
}

亲自试一试

మోడల్ నమోదు ఫారమ్ ఎలా సృష్టించాలి

మొదటి చర్య - HTML జోడించండి:

ఇన్పుట్ నిర్వహించడానికి <form> ఎలమెంట్ ఉపయోగించండి. మా PHP శిక్షణలో మరింత సమాచారం కలిగి ఉంటుంది.

ప్రతి ఫీల్డ్ కు ఇన్పుట్ కంట్రోల్ జోడించండి (అనురూప టాగ్లు తో):

<!-- మోడల్ తెరిచే బటన్ -->
<button onclick="document.getElementById('id01').style.display='block'">నమోదు చేయండి</button>
<!-- మోడల్ (నమోదు ఫారమ్ ఉంది) -->
<div id="id01" class="modal">
  <span onclick="document.getElementById('id01').style.display='none'" class="close" title="మూసివేయండి">టైమ్స్;</span>
  <form class="modal-content" action="/action_page.php">
    <div class="container">
      <h1>రిజిస్టర్ చేయండి</h1>
      <p>ఒక ఖాతా సృష్టించడానికి ఈ ఫారమ్ ను పూరించండి.</p>
      <hr>
      <label for="email"><b>ఇమెయిల్</b></label>
      <input type="text" placeholder="ఇమెయిల్ ప్రవేశం చేయండి" name="email" required>
      <label for="psw"><b>పాస్వర్డ్</b></label>
      <input type="password" placeholder="పాస్వర్డ్ ప్రవేశం చేయండి" name="psw" required>
      <label for="psw-repeat"><b>పునఃప్రవేశం చేయండి</b></label>
      <input type="password" placeholder="పునఃప్రవేశం చేయండి" name="psw-repeat" required>
      <label>
        <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px"> నాకు జ్ఞాపకం పంచుకొనండి
      </label>
      <p>ఒక ఖాతా సృష్టించడం ద్వారా మీరు మా <a href="#" style="color:dodgerblue">నిబంధనలు & గోప్యతా విధానాన్ని</a> అంగీకరిస్తున్నారు.</p>
      <div class="clearfix">
        <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">రద్దు చేయండి</button>
        <button type="submit" class="signup">Sign Up</button>
      </div>
    </div>
  </form>
</div>

दूसरा - CSS जोड़ें:

* {box-sizing: border-box}
/* पूर्ण चौड़ाई इनपुट फील्ड */
  input[type=text], input[type=password] {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  display: inline-block;
  border: none;
  background: #f1f1f1;
}
/* इनपुट बॉक्स ध्यान में आए जबकि पृष्ठभूमि रंग जोड़ें */
input[type=text]:focus, input[type=password]:focus {
  background-color: #ddd;
  outline: none;
}
/* सभी बटन के लिए शैली सेट करें */
button {
  background-color: #04AA6D;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
  opacity: 0.9;
}
button:hover {
  opacity:1;
}
/* रद्द बटन के अतिरिक्त शैली सेट करें */
.cancelbtn {
  padding: 14px 20px;
  background-color: #f44336;
}
/* रद्द और पंजीकरण बटन फ्लोटिंग करें और समान चौड़ाई निर्धारित करें */
.cancelbtn, .signupbtn {
  float: left;
  width: 50%;
}
/* कंटेनर तत्व को आंतरिक सीमा जोड़ें */
.container {
  padding: 16px;
}
/* मॉडल (पृष्ठभूमि) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: #474e5d;
  padding-top: 50px;
}
/* మోడల్ కంటెంట్/ఫ్రేమ్ */
.modal-content {
  background-color: #fefefe;
  margin: 5% auto 15% auto; /* పైకి 5%, క్రిందికి 15%, మరియు మధ్యలో */
  border: 1px solid #888;
  width: 80%; /* స్క్రీన్ పరిమాణం అనుసారం మరింత లేదా తక్కువగా ఉండవచ్చు */
}
/* హెరిట్జ్ లైన్ శైలిని అమర్చండి */
hr {
  border: 1px solid #f1f1f1;
  margin-bottom: 25px;
}
/* మూసివేసిన బటన్ (x) */
.close {
  position: absolute;
  right: 35px;
  top: 15px;
  font-size: 40px;
  font-weight: bold;
  color: #f1f1f1;
}
.close:hover,
.close:focus {
  color: #f44336;
  cursor: pointer;
}
/* ఫ్లాట్స్ ని శుభ్రం చేయండి */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}
/* చిన్న స్క్రీన్ పై రద్దు బటన్లు మరియు రిజిస్టర్ బటన్ల శైలిని మార్చండి */
@media screen and (max-width: 300px) {
  .cancelbtn, .signupbtn {
    width: 100%;
  }
}

అనురూపం:మీరు కూడా ఈ క్రింది JavaScript కోడ్ ను ఉపయోగించవచ్చు, మోడల్ కంటెంట్ బాహ్య ఏదైనా స్పూర్తిని నొక్కి మోడల్ ను మూసివేయడానికి (కేవలం "×" లేదా "cancel" బటన్లను ఉపయోగించడం మాత్రమే కాదు):

<script>
// మోడల్ పొందండి
var modal = document.getElementById('id01');
// ఉపయోగదారుడు మోడల్ బాహ్య ఏదైనా స్పూర్తిని నొక్కినప్పుడు దానిని మూసివేస్తారు
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}
</script>

亲自试一试

相关页面

教程:HTML 表单

教程:CSS 表单