
HTML Series: How to Create Links in HTML
Previously, we showed you how to create your first HTML page, now we want to show you how to create links to navigate between pages.
Welcome to Silicon Overdrive!
Home » Blog » Software Development » HTML Series: How to create a basic HTML form
Would you like to know how to help users get in touch with you on your website without displaying your contact info where bots can find it and spam your email? A simple solution is to add a contact form to your site to allow users to send you a message without sharing your email with everyone on the Internet.
Follow our tips below to learn how to create a basic form in HTML and see how you can make use of PHP or JavaScript to make it functional.
Yes. A form is a great way to get to know the users visiting your site.
The basic element to create a form in HTML is the < form > tag. This tag includes other elements such as < input >, < textarea >, < button >, < label >, etc.
HTML Structure:
< form action=”/example.php” method=”get” >
< label for=”fname” >First Name:</ label >
< input type=”text” id=”fname” name=”fname” >
< input type=”submit” value=”Submit” >
</ form >
The above code will submit the user’s First Name (fname) and send it to the php file on the server called example.php.
The < input > tag specifies the input field where users are able to add their information.
HTML Structure:
< form action=”/example.php” method=”get” >
< label for=”fname”>First Name:</ label >
< input type=”text” id=”fname” name=”fname” >
< input type=”submit” value=”Submit” >
</ form >
There are various types of input for input elements that allows users to input data other than simple text:
The < select > tag is a useful tag if you want to add a drop-down list to your form, allowing users to choose from a range of options.
HTML Structure:
< label for=”services” >Choose a Service:</ label >
< select name=”service” id=”service” >
< option value=”it-services” >IT Services & Support</ option >
< option value=”aws” >Amazon Web Services</ option >
< option value=”awsdevops” >Amazon Web Services DevOps</ option >
< option value=”microsoft” >Microsoft 365</ option >
< option value=”seo” >SEO & Digital Marketing</ option >
</ select >
< input type=”submit” value=”Submit” >
By using the “multiple” attribute, users are able to select more than one option.
HTML Structure:
< label for=”services” >Choose a Service:</ label >
< select name=”service” id=”service” multiple >
< option value=”it-services” >IT Services & Support</ option >
< option value=”aws” >Amazon Web Services</ option >
< option value=”awsdevops” >Amazon Web Services DevOps</ option >
< option value=”microsoft” >Microsoft 365</ option >
< option value=”seo” >SEO & Digital Marketing</ option >
</ select >
The < textarea > tag defines a multiline area for users to input information, often used to add a message with other form details.
HTML Structure:
< label for=”message” >Message:</ label >
< textarea id=”message” name=”message” rows=”4″ cols=”50″ >
</ textarea >
< input type=”submit” value=”Submit” >
The
HTML Structure:
< form action=”/example.php” method=”get” >
< label for=”fname”>First Name:</ label >
< input type=”text” id=”fname” name=”fname” >
< input type=”submit” value=”Submit” >
</ form >
The < fieldset > groups form elements together and the tag provides a caption for < fieldset > elements.
HTML Structure:
< form action=”example.php”>
< fieldset >
< legend >User: </ legend >
< label for=”name” >Name:</ label >
< input type=”text” id=”name” name=”name “>
< label for=”surname” >Surname:</ label >
< input type=”text” id=”lname” name=”lname” >
< input type=”submit” value=”Submit” >
</ fieldset >
</ form >
The < button > tag creates a clickable button.
HTML Structure:
< button type=”button”>Click Here</ button >
Other attributes that can be used with the button element includes autofocus, disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, name, type, and value.
The < optgroup > tag groups different < option > tags in one group. These option tags are used within a < select > element.
HTML Structure:
< label for=”services” >Choose a Service:</ label >
< select name=”service” id=”service”>
< optgroup label=”IT Services”>
< option value=”it-services” >IT Services & Support</ option >
</ optgroup >
< optgroup label=”Cloud Services” >
< option value=”aws” >Amazon Web Services</ option >
< option value=”awsdevops” >Amazon Web Services DevOps</ option >
< option value=”azure” >Microsoft Azure</ option >
</ optgroup >
</ select >
< input type=”submit” value=”Submit” >
The < datalist > tag provides pre-defined options while allowing the user to type their input. Think about Google’s search bar, as you type in keywords, suggestions start displaying at the bottom.
HTML Structure:
< form action=”example.php” method=”get” >
< label for=”services” >Choose a service from the list:</ label >
< input list=”services” name=”services” id=”services” >
< datalist id=”services”>
< option value=”IT Services” >
< option value=”Cloud Services” >
< option value=”Digital Marketing Services” >
< option value=”Microsoft Services” >
</ datalist >
< input type=”submit” >
The < output > tag performs a calculation and displays the result in the < output > element.
< form oninput=”x.value=parseInt(a.value)+parseInt(b.value)”>
< input type=”range” id=”a” value=”50″>
+< input type=”number” id=”b” value=”25″>
=< output name=”x” for=”a b”></ output >
</ form >
Now you are ready to build a basic form in HTML.
The form below is only showcasing the basic code structure needed to build the form, you still need to make use of PHP or JavaScript to make the form functional.
< form action=”/example.php” >
< label for=”fname”>First name:</ label >
< input type=”text” id=”fname” name=”fname” >
< label for=”lname”>Last name:
< input type=”text” id=”lname” name=”lname” >
< label for=”message”>Message:
< textarea id=”message” name=”message” rows=”4″ cols=”50″>
< input type=”submit” value=”Submit”>
</ form>
To ensure your form works when a user enters their information and clicks on the submit button, you need to add PHP or JavaScript elements.
In PHP, forms make use of $_GET and $_Post to collect form data.
When to use:
Follow this link to see how to create a basic form with HTML and PHP.
Step 1: Create your HTML form
Step 2: Create your Javascript file and include it in your HTML file
Step 3: Add some CSS styling (this is optional, although a good looking form will be better)
Follow the steps below to create a simple form with HTML and Javascript:
https://www.formget.com/javascript-contact-form/
If you need specific information from users, you can specify that that field is mandatory or required. This attribute will ensure a message displays that the user cannot submit the form without entering information in the required fields.
HTML Structure:
< form action=”/example.php”>
< label for=”fname” >First name:
< input type=”text” id=”fname” name=”fname” required >
< input type=”submit” value=”Submit” >
</ form>
Now that you are able to create forms in HTML, it’s time we move on to some CSS! This is where we start making your HTML code look amazing by styling all the elements.
Bookmark our Blog or like and follow our Facebook and LinkedIn page to continue learning with us.

Previously, we showed you how to create your first HTML page, now we want to show you how to create links to navigate between pages.

In last week’s introduction to HTML, we talked about the markup language and some of its elements like Tags. Let’s take an in-depth look at HTML Tags.

What is HTML? What does it stand for? What’s a tag? What’s an attribute? Let’s take a look at all this in the HTML Series: An Introduction to HTML.
Trend Micro Cloud OneConformity Awarded both AWS Cloud Management Tools Competency and Security Partner Competency, Cloud Conformity’s security and governance platform delivers continuous assurance that your infrastructure is compliant, secure, and optimized. You can pull instant compliance reports for major,

Trend Micro Workload Security Trend Micro Workload Security is a comprehensive security and cloud protection suite that scales seamlessly and helps you maintain continuous compliance. Workload Security protects your AWS workloads against threats, malware and vulnerabilities with IPS/IDS, application control,

Considering switching from in-house email to cloud email? Then you might want to consider using..
We use cookies to track visitors, measure ads, ad campaign effectiveness and analyze site traffic. We may also share information about your use of our site with 3rd parties. For more info, see, our Cookies Policy, our Privacy Notice. By clicking “Accept All” you agree to the storing of all cookies on your device. In case you don’t choose one of these options and use our website, we will treat it as if you have accepted all cookies.
We use cookies to track visitors, measure ads, ad campaign effectiveness and analyze site traffic. We may also share information about your use of our site with 3rd parties. For more info, see, our Cookies Policy, our Privacy Notice. By clicking “Accept All” you agree to the storing of all cookies on your device. In case you don’t choose one of these options and use our website, we will treat it as if you have accepted all cookies.