Skip to content

Steps to Create an HTML Form with KompoZer πŸ“

  1. Open KompoZer and Start a New HTML Page: πŸš€
    • Launch KompoZer.
    • Go to File > New πŸ“„ or click the "New" button on the toolbar.
    • Shortcut: Ctrl + N (Windows/Linux) or Cmd + N (Mac) to create a new blank HTML document.
  2. Configure Page Title and Properties: ✨
    • Go to Format** > **Page Title and Properties**. **Shortcut: Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac).
    • This will open the "Page Properties" dialog box, which contains several tabs. The "General" tab is where you'll find the most crucial metadata fields.
    • In the "Page Properties" dialog, on the "General" tab, you'll see a field labeled "Title:".
    • Enter your desired page title here. 🏷️ (e.g., My Awesome Product Page | MyCompany)
    • Enter your desired page author here. ✍️ (e.g., VD)
    • Click "OK". πŸ‘
  3. Save Your HTML File: πŸ’Ύ
    • Go to File** > **Save** or click the "Save" button. **Shortcut: Ctrl + S (Windows/Linux) or Cmd + S (Mac).
    • Save your HTML file by providing a related name without space & with a .html extension (e.g., userSignUp.html).
  4. Insert the Form Element: πŸ“
    • Place your cursor where you want the form to appear on your page.
    • Go to **Insert** > **Form** > **Define Form**.
    • The "Form Properties" dialog box will appear.
  5. Configure Form Properties: βš™οΈ
    • Form Name: Give your form a descriptive name (e.g., "regForm", "contactForm", "registrationForm"). This is useful for JavaScript or for organizing multiple forms.
    • Action URL: This is the most important part. It's the URL of the script on your server that will process the form data when it's submitted. This could be a PHP, ASP, Python, Perl, or other server-side script. πŸ’»
      • Example: process_form.php or submit.asp
    • Method:
      • GET: Appends the form data to the URL as query parameters. Suitable for simple, non-sensitive data and when you want users to be able to bookmark the results. πŸ”—
      • POST: Sends the form data in the body of the HTTP request. This is generally preferred for sensitive data (passwords, credit card numbers) or when sending large amounts of data, as it doesn't show in the URL. πŸ”’
    • Click "OK". πŸ‘ You'll see a dashed rectangle appear on your page, indicating the boundaries of your form.
  6. Insert a Table for Layout (Optional but Recommended): πŸ“Š

    Before adding your fields, it’s a great idea to use a table. This keeps your labels (like "First Name") on the left and your input boxes on the right, perfectly aligned! πŸ“

    • Place your cursor inside the dashed rectangle of your form.
    • Go to Insert > Table. πŸ–±οΈ
    • In the "Quick" tab, drag your mouse to select the number of rows and columns.
      • Rows: However many fields you need (e.g., 5 or 6).
      • Columns: Select 2 (one for the label, one for the input field).
    • Adjust Table Look: Right-click the table and select Table Cell Properties, then click the Table tab. βš™οΈ
      • Set Border to 0 if you want the layout to be invisible.
      • Set Spacing to 5 to give your fields some breathing room.
    • Click "OK". πŸ‘
    • Now, when you follow Step 6, type your labels in the left cells and insert your form fields in the right cells! ✍️
    • Add Form Elements (Input Fields, Text Areas, Buttons, etc.): βž•

    Now you'll add the actual fields users will interact with.

    • Text Input Fields: πŸ”‘
      • Place your cursor inside the dashed form rectangle.
      • Go to **Insert** > **Form** > **Form Field**
      • In the "Form Field Properties" dialog:
        • Field Type: Select "**Text**"
        • Field Name: Give it a unique, descriptive name (e.g., "fname", "lname", "firstName", "email", "username"). This is how your server-side script will identify the data.
        • Initial Value (Optional): To pre-populate the field with some text. πŸ“
        • Max Length (Optional): Limit the number of characters. πŸ“
      • Click "OK". πŸ‘
      • Before or after adding the field, type a label next to it (e.g., "First Name:", "Email:") so users know what to enter. πŸ§‘β€πŸ’»
      • πŸ’‘ Remember to Test Your Changes! After adding or adjusting a textbox or its label (e.g., adding a space after the label), save your HTML file (Step 7) and open it in a web browser (Step 8) to ensure it appears as expected. Even small changes can impact the layout! 🧐
    • Password Fields: πŸ”‘
      • Similar to Text Input, but select "Password" as the Field Type. Characters entered will be masked. πŸ™ˆ
      • πŸ’‘ Remember to Test Your Changes! After adding or adjusting a password box or its label (e.g., adding a space after the label), save your HTML file (Step 7) and open it in a web browser (Step 8) to ensure it appears as expected. Even small changes can impact the layout! 🧐
    • Text Areas (Multi-line Input): ✍️
      • Place your cursor inside the form.
      • Go to **Insert** > **Form** > **Textarea**
      • In the "Textarea Properties" dialog:
        • Textarea Name: Unique name (e.g., "comments", "message").
        • Rows: Number of visible rows. πŸ“
        • Columns: Number of visible columns (width). ↔️
      • Click "OK". πŸ‘
      • πŸ’‘ Remember to Test Your Changes! After adding or adjusting a textarea or its label (e.g., adding a space after the label), save your HTML file (Step 8) and open it in a web browser (Step 8) to ensure it appears as expected. Even small changes can impact the layout! 🧐
    • Checkboxes: βœ…
      • Place your cursor inside the form.
      • Go to **Insert** > **Form** > **Form Field**
      • Field Type: Select "Checkbox"
      • Field Name: Name for the group of checkboxes (e.g., "interests").
      • Field Value: The actual value sent to the server if this specific checkbox is checked (e.g., "sports", "reading").
      • Initial State: Check "Checked" if you want it pre-selected. βœ”οΈ
      • Click "OK". πŸ‘
      • Type the label next to each checkbox (e.g., "Sports", "Reading"). πŸ€πŸ“š
      • πŸ’‘ Remember to Test Your Changes! After adding or adjusting a checkbox or its label (e.g., adding a space after the label), save your HTML file (Step 8) and open it in a web browser (Step 8) to ensure it appears as expected. Even small changes can impact the layout! 🧐
    • Radio Buttons: πŸ”˜
      • Place your cursor inside the form.
      • Go to **Insert** > **Form** > **Form Field**
      • Field Type: Select "Radio Button"
      • Field Name: Crucially, all radio buttons in a group must have the same Field Name (e.g., "gender", "paymentMethod"). 🀝
      • Field Value: The unique value for this specific radio button (e.g., "male", "female", "creditCard", "paypal").
      • Initial State: Check "Checked" if you want it pre-selected (only one in a group can be checked initially). βœ”οΈ
      • Click "OK". πŸ‘
      • Type the label next to each radio button (e.g., "Male", "Female"). πŸ‘¨β€πŸ¦°πŸ‘©β€πŸ¦°
      • πŸ’‘ Remember to Test Your Changes! After adding or adjusting a radio button or its label, save your HTML file (Step 7) and open it in a web browser (Step 8) to ensure it appears and behaves correctly. 🧐
    • Selection Lists (Dropdowns): πŸ”½
      • Place your cursor inside the form.
      • Go to **Insert** > **Form** > **Selection List**
      • In the "Selection List Properties" dialog:
        • List Name: Unique name (e.g., "country", "state").
        • Multiple Selections Allowed: Check if users can select more than one option (hold Ctrl/Cmd to select multiple). βœ…
        • List Size: Number of visible options without scrolling. πŸ”’
      • Click "Add Option..." for each item in your dropdown. βž•
        • Option Text: What the user sees (e.g., "United States"). πŸ‡ΊπŸ‡Έ
        • Option Value: What is sent to the server (e.g., "USA").
        • Initially Selected: Check if this option should be pre-selected. βœ”οΈ
      • Use the "Move Up" ⬆️ and "Move Down" ⬇️ buttons to reorder options.
      • Click "OK". πŸ‘
      • πŸ’‘ Remember to Test Your Changes! After adding or adjusting a dropdown list, save your HTML file (Step 7) and open it in a web browser (Step 8) to ensure it displays and functions as intended. 🧐
    • Submit Button: πŸš€
      • Place your cursor inside the form.
      • Go to **Insert** > **Form** > **Form Field**
      • Field Type: Select "Submit Button"
      • Field Name (Optional): Can be left blank or given a name if your script needs to identify the specific submit button used (less common).
      • Field Value: The text that appears on the button (e.g., "Save", "Submit", "Send Message"). πŸ“¨
      • Click "OK". πŸ‘
    • Reset Button: πŸ”„
      • Similar to Submit Button, but select "Reset Button" as the Field Type. This button resets all form fields. 🧹
    • Save Your HTML File (Again!): πŸ’Ύ
    • After adding or changing any element, always go to File** > **Save** or click the "Save" button to ensure your latest modifications are stored. This is crucial before testing! **Shortcut: Ctrl + S (Windows/Linux) or Cmd + S (Mac).
    • Test Your Form (Locally): 🌐πŸ§ͺ
    • Open your saved HTML file in a web browser (you can usually double-click the .html file from your computer's file explorer).
    • Fill out the form and interact with all the fields you've added.
    • Observe Carefully:
      • Do all the labels appear correctly?
      • Are fields aligned as you expect?
      • Do checkboxes and radio buttons select/deselect properly?
      • Does the dropdown list show all your options?
      • Do spaces or other formatting appear as intended?
      • If something looks wrong, go back to KompoZer, make the fix, and repeat steps 7 & 8! This cycle of "change, save, test" is fundamental to web development. πŸ”„
    • Important: Since you don't have a server-side script running locally, clicking "Submit" will likely result in a "File not found" 🚫 or "Page not found" error if your "Action URL" points to a server-side script. This is normal. You're testing the front-end appearance and functionality of the form fields. βœ…

Our Example

Form Name: regForm

Field Labels HTML Element Type Field Name Field Value/s
First name <input> text fname
Last name <input> text lname
Email <input> email email
Password <input> password pass
Confirm Password <input> password cpass
Mobile number <input> number or text mob
Pin-code <input> number or text pcode
Date of Birth <input> date or text bdate
Hobbies <input> checkbox hobby Reading , Writing, Singing, Dancing
Gender <input> radio gen Male , Female, Others
City <select> & <option> ct
Address <textarea></textarea>
<input> submit submit submit
<input> reset reset reset