Problem

Create a Lightning Web Component ( LWC) to display a registration form with input fields and a submit button.

Instructions

  • Create a simple form with three lightning-input fields with labels First name, Last name and Email.
  • Add a submit lightning-button on the form.
  • On click of submit button, hide the input fields and display the values entered on the form as output text on screen.
  • Output screen should display each input values in a separate paragraph tags.

Sample output

lwc simple registration form output

Note : This exercise introduces you to writing a simple LWC component that reads data from input fields using onchange events and display them on the screen using data binding. Focus on meeting the requirements, and feel free to validate your code using the execute button.

To get started with lightning web components, click our free course below. Free LWC Course.

  • <>simpleRegistration.html
  • JSsimpleRegistration.js
  • #simpleRegistration.css
Loading...
show full screen editor