<form>
<label for="name">Name:</label>
<input type="text" id="name" name="username">
<input type="submit" value="Submit">
</form>
HTML Forms in Hindi
HTML में form का उपयोग user से input लेने के लिए किया जाता है। जब भी किसी वेबसाइट पर user से information लेनी होती है – जैसे name, email, password, feedback – तब HTML form की मदद ली जाती है।
Form बनाने के लिए <form> tag का use होता है। इस tag के अंदर हम अलग-अलग input fields डालते हैं जैसे – text box, radio buttons, checkboxes, submit button आदि।
ऊपर दिए गए code में एक simple form है जिसमें user अपना नाम enter कर सकता है और Submit बटन से भेज सकता है।
हर input field को पहचानने के लिए उसका name attribute बहुत important होता है। यही attribute form data को server तक पहुँचाने में मदद करता है।
Form को भेजने के लिए <input type="submit"> या <button type="submit"> use किया जाता है। जब user submit करता है तो data server पर या किसी script को भेजा जाता है।
Form में आप अलग-अलग types के input fields जोड़ सकते हैं, जैसे:
- text – normal input
- email – email address
- password – hidden characters
- radio – single choice
- checkbox – multiple choice
- textarea – लंबा text input
आप form को और भी powerful बनाने के लिए select, datalist, aur fieldset जैसे elements का भी use कर सकते हैं।
HTML forms को CSS से style किया जा सकता है ताकि वो visually attractive और user-friendly लगें।
Forms वेबसाइट पर user interaction के सबसे जरूरी हिस्सों में से एक होते हैं। ये login, registration, contact, feedback जैसे tasks में use होते हैं।
HTML Form Example
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic HTML Form Example</title>
</head>
<body>
<h2>Registration Form</h2>
<form action="#" method="post">
<label for="fullname">Full Name:</label><br>
<input type="text" id="fullname" name="fullname"><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br><br>
<label>Gender:</label><br>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label><br>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label><br><br>
<label>Hobbies:</label><br>
<input type="checkbox" id="reading" name="hobby" value="reading">
<label for="reading">Reading</label><br>
<input type="checkbox" id="traveling" name="hobby" value="traveling">
<label for="traveling">Traveling</label><br>
<input type="checkbox" id="music" name="hobby" value="music">
<label for="music">Music</label><br><br>
<label for="message">Your Message:</label><br>
<textarea id="message" name="message" rows="4" cols="40"></textarea><br><br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
Request
अगर आपको यह article useful या interesting लगा हो, तो please इसे अपने dosto aur family ke साथ जरूर share करें। आपका एक छोटा सा कदम हमें और अच्छा content बनाने के लिए motivate करता है। Thank you!
ध्यान दें कि इस page पर आपको कुछ ads भी देखने को मिल सकते हैं। इसके लिए हम आपसे माफी चाहते हैं। हम इस content को तैयार करने में काफी मेहनत और time लगाते हैं, ताकि आपको valuable जानकारी मिल सके। इन्हीं ads की मदद से हम ये काम continue कर पाते हैं।
आपके support और understanding के लिए दिल से धन्यवाद।