Breaking

Wednesday, 24 May 2017

HTML forms in Hindi Part 10

HTML forms  in Hindi Part 10 :



HTML forms 

  • Introduction to HTML forms in Hindi 
  • <form> tag in HTML forms in Hindi 
  • <input> tag in HTML forms in Hindi 
  • Attributes of form tag in Hindi 

Introduction to HTML forms 

किसी भी webpage पर यदि आप यूज़र से कोई information लेना चाहते है तो इसके लिए आप forms का इस्तेमाल करते है। उदाहरण के लिए जब भी आप कोई नयी email id create करते है तो सबसे पहले sign up form भरते है। ऐसा करके आप अपनी information webpage के द्वारा provide करते है। Forms यूज़र से input प्राप्त करने का सबसे common तरीका होता है। कोई भी form यूज़र से input लेता है और जब यूज़र उस form को submit करता है तो ये सारी information किसी database में store कर ली जाती है। User से information input करवाने के लिए आप कई प्रकार के form elements यूज़ कर सकते है। जैसे की text-box, radio button, drop-down list आदि।

किसी भी webpage में forms create करने के लिए आप <form> tag यूज़ करते है। ये container tag होता है जो की पुरे form की beginning और ending define करता है। इस tag के अंदर अलग अलग form elements define किये जाते है। <form> tag के कुछ attributes के बारे में नीचे दिया जा रहा है।


 Attribute 
Explanation  
action  
इस attribute से आप define करते है की form submit होने पर क्या करना है। जैसे की यूज़र के form submit करते ही आप कोई दूसरे webpage में thank you message शो कर सकते है या कोई php script execute करवा सकते है।     
method  
इस attribute से आप data को store करने का method define करते है। इस attribute की केवल 2 values GET या POST हो सकती है।    
target 
इससे आप form submission के बाद जो window show होगी वह define करते है।   

Form elements आप <input> tag के द्वारा define करते है। इस tag के कुछ attributes होते है जो आप elements को configure करने के लिए यूज़ करते है। इनके बारे में नीचे दिया जा रहा है।


 Attribute 
Explanation  
name  
इस attribute से particular form element का नाम define किया जाता है। बाद में यही नाम server value को store करने के लिए यूज़ करता है।    
type  
ये element का type show करता है। इससे ये भी पता चलता है की किस तरह की value input की जा सकती है। जैसे text-boxes के लिए type text होता है।     
size 
इससे से आप किसी form element की size width में define करते है। जैसे की आप किसी text-box अपने according width दे सकते है।    
value 
ये किसी element की default value हो सकती है। जैसे की आप किसी text box के अंदर first name लिखा हुआ देखते है।    
 
आइये अब देखते है की इन tags और attributes को यूज़ करते हुए आप कैसे एक complete form create कर सकते है।

Creating text boxes

HTML में forms के लिए text-boxes क्रिएट करना बहुत ही easy है। इसके लिए आप <input> tag के type attribute में text value define करते है। कोई भी default value देने के लिए जो text-box के अंदर show होगी आप value attribute यूज़ कर सकते है। यदि आप password input करने  के लिए text-box बना रहे है तो type password देना होगा। इसका उदाहरण नीचे दिया जा रहा है।   

<html>
<head>
<title>Text box demo</title>
</head>

<body>

<form>
Enter your email :<input type="text" value="Email..." name="email" size=" 20"> <br><br>
Enter your password :<input type="password" value="Password..." name="pass" size="20">
</form>

</body>

</html> 

ऊपर दी गयी script निचे दिया गया web page generate करेगी।

HTML-form-example-output

No comments:

Post a Comment