About

Breaking

Monday 22 May 2017

Advance Html

                                                                         Advance Html



A large part of developing a web based application involves handling interaction with user via their web browsers. One of the most common tasks in this area of web development involves presenting the user with forms to collect information, and then processing that information.
Web forms are typically created using the HTML <FORM> element together with various user interface objects (such as text fields, toggle buttons and push buttons).
Before exploring the interaction between PHP and the HTML form elements it is first important to have a basic understanding of HTML forms. The purpose of this chapter, therefore, is to provide this basic grounding before moving on to the more PHP specific areas of building a form. If you are already familiar with HTML forms feel free to move on to PHP and HTML Forms.


वेब आधारित अनुप्रयोग विकसित करने का एक बड़ा हिस्सा अपने वेब ब्राउज़र के माध्यम से उपयोगकर्ता के साथ बातचीत को संभालना शामिल करता है वेब डेवलपमेंट के इस क्षेत्र में सबसे सामान्य कार्यों में से एक में जानकारी इकट्ठा करने के लिए यूजर के साथ प्रस्तुत करना शामिल है, और फिर उस सूचना को प्रोसेस करना।
वेब प्रपत्र आमतौर पर विभिन्न यूजर इंटरफेस ऑब्जेक्ट्स (जैसे टेक्स्ट फ़ील्ड, टॉगल बटन और पुश बटन) के साथ HTML <FORM> तत्व का उपयोग करके बनाया जाता है
पीएचपी और एचटीएमएल फार्म तत्वों के बीच बातचीत की खोज करने से पहले, HTML रूपों की मूल समझ रखने के लिए सबसे पहले यह महत्वपूर्ण है। इसलिए, इस अध्याय का उद्देश्य एक फार्म का निर्माण करने के और अधिक विशिष्ट विशिष्ट क्षेत्रों पर जाने से पहले इस आधारभूत आधार प्रदान करना है। यदि आप पहले से ही एचटीएमएल फॉर्म से परिचित हैं, तो PHP और एचटीएमएल फॉर्म पर जाने के लिए स्वतंत्र महसूस करें।

Creating HTML Forms

HTML forms are used to collect data from users. Users essentially enter data into forms by filling in text fields, selecting toggles and making choices from selection objects. When the user has filled in the data it is transmitted to the server for processing.
HTML forms are specified using the <form> element. The form element contains an attribute that specifies the script on the server to which the gathered data is to be sent. Data can be sent to the server using one of two methods, GET or POST. With GET, all the data is passed to the server embedded in the URL. POST is typically used for larger volumes of data.
The various <input> elements are then specified within the body of the <form>.
With this information in mind we can create a simple HTML form containing a text field input and a submit button as follows:

HTML फॉर्म बनाना
एचटीएमएल प्रपत्रों का प्रयोग उपयोगकर्ताओं से डेटा एकत्र करने के लिए किया जाता है। उपयोगकर्ता मूल रूप से टेक्स्ट फ़ील्ड भर कर, टॉगल चुनने और चयन ऑब्जेक्ट्स से विकल्प बनाने के द्वारा फ़ॉर्म में डेटा दर्ज करते हैं। जब उपयोगकर्ता ने डेटा भर दिया है, तो उसे प्रसंस्करण के लिए सर्वर में प्रेषित किया जाता है।
HTML प्रपत्र को <form> तत्व का उपयोग करके निर्दिष्ट किया जाता है प्रपत्र तत्व में एक विशेषता है जो सर्वर पर स्क्रिप्ट को निर्दिष्ट करती है जिसमें एकत्रित डेटा भेजा जाना है। डेटा दो तरीकों, प्राप्त या पोस्ट का उपयोग करके सर्वर को भेजा जा सकता है GET के साथ, सभी डेटा यूआरएल में एम्बेडेड सर्वर को भेजे जाते हैं। आम तौर पर डाक के डेटा के बड़े संस्करणों के लिए उपयोग किया जाता है
विभिन्न <input> तत्व तब <form> के शरीर के भीतर निर्दिष्ट होते हैं
इस जानकारी को ध्यान में रखते हुए हम एक साधारण HTML फ़ॉर्म बना सकते हैं जिसमें टेक्स्ट फ़ील्ड इनपुट और एक सबमिट बटन होगा।
 <html>
<head>
<title>Simple HTML Form</title>
</head>
<body>

<form action="submit.php" method="post">
<input type="text" name="customerName" value="Default text here" />
<input type="submit" name="submit_button" value="Press to Submit" />

</form>
</body>
</html> 



<html>
<body>

<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="iron man">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="hulk">
  <br><br>
  <input type="submit" value="Submit">
</form>



</body>
</html>



The <form> Element

The HTML <form> element defines a form that is used to collect user input:


<form>
.
form elements
.
</form>



An HTML form contains form elements.
Form elements are different types of input elements, like text fields, checkboxes, radio buttons, submit buttons, and more.

The <input> Element

The <input> element is the most important form element.
The <input> element can be displayed in several ways, depending on the type attribute.
Here are some examples:
TypeDescription
<input type="text">Defines a one-line text input field
<input type="radio">Defines a radio button (for selecting one of many choices)
<input type="submit">Defines a submit button (for submitting the form)




<input type="text"> defines a one-line input field for text input:

Example

 

<html>
<body>

<form>
  First name:<br>
  <input type="text" name="firstname">
  <br>
  Last name:<br>
  <input type="text" name="lastname">
</form>

<p>Note that the form itself is not visible.</p>

<p>Also note that the default width of a text input field is 20 characters.</p>

</body>
</html>



    MORE FEATURE


  1. Radio Button Input
  2. The Submit Button
  3. The Name Attribute
  4. Grouping Form Data with <fieldset> 


The Action Attribute

The action attribute defines the action to be performed when the form is submitted.
Normally, the form data is sent to a web page on the server when the user clicks on the submit button.
In the example above, the form data is sent to a page on the server called "/action_page.php". This page contains a server-side script that handles the form data:

  <form action="/action_page.php">

कार्य विशेषता
एक्शन एट्रिब्यूट फॉर्म को प्रस्तुत किए जाने पर किए जाने वाले कार्य को परिभाषित करता है।

आम तौर पर, फ़ॉर्म डेटा सर्वर पर एक वेब पेज पर भेजा जाता है जब उपयोगकर्ता सबमिट बटन पर क्लिक करता है।

उपरोक्त उदाहरण में, फ़ॉर्म डेटा "/action_page.php" नामक सर्वर पर एक पृष्ठ पर भेजा जाता है इस पृष्ठ में एक सर्वर-साइड स्क्रिप्ट है जो फ़ॉर्म डेटा संभालता है:

<form action="/action_page.php">


If the action attribute is omitted, the action is set to the current page.

The Method Attribute

The method attribute specifies the HTTP method (GET or POST) to be used when submitting the form data:


यदि क्रिया विशेषता छोड़ी गई है, तो कार्रवाई वर्तमान पृष्ठ पर सेट की गई है।

विधि विशेषता
फॉर्म एट्रिब्यूट फॉर्म डेटा जमा करते समय उपयोग करने के लिए HTTP विधि (GET या POST) निर्दिष्ट करता है:


<form action="/action_page.php" method="get">


OR


<form action="/action_page.php" method="post">


When to Use GET?

The default method when submitting form data is GET.
However, when GET is used, the submitted form data will be visible in the page address field:




GET का उपयोग कब करना है?
फ़ॉर्म डेटा सबमिट करते समय डिफ़ॉल्ट विधि GET है

हालांकि, जब GET का उपयोग किया जाता है, तो प्रस्तुत फ़ॉर्म डेटा पृष्ठ पता फ़ील्ड में दिखाई देगा:


/action_page.php?firstname=Mickey&lastname=Mouse




When to Use POST?

Always use POST if the form data contains sensitive or personal information. The POST method does not display the submitted form data in the page address field.
POST has no size limitations, and can be used to send large amounts of data.


पोस्ट का उपयोग कब करना है?
अगर फॉर्म डेटा में संवेदनशील या व्यक्तिगत जानकारी होती है तो हमेशा POST का उपयोग करें POST विधि पृष्ठ पता फ़ील्ड में सबमिट किए गए फ़ॉर्म डेटा प्रदर्शित नहीं करती है।

पोस्ट की कोई सीमा नहीं है, और बड़ी मात्रा में डेटा भेजने के लिए उपयोग किया जा सकता है




Here is the list of <form> attributes:

AttributeDescription
accept-charsetSpecifies the charset used in the submitted form (default: the page charset).
actionSpecifies an address (url) where to submit the form (default: the submitting page).
autocompleteSpecifies if the browser should autocomplete the form (default: on).
enctypeSpecifies the encoding of the submitted data (default: is url-encoded).
methodSpecifies the HTTP method used when submitting the form (default: GET).
nameSpecifies a name used to identify the form (for DOM usage: document.forms.name).
novalidateSpecifies that the browser should not validate the form.
targetSpecifies the target of the address in the action attribute (default: _self).

No comments:

Post a Comment