Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Task 10: Form Validation and JSON #90

Description

@PradyumnaKrishna

Task
Create a HTML task10.html, that contains a form with:

  • A selection that takes a function linear, inverse and log.
  • A input that takes a number.
  • A submit button.

Mark both input as required.

Use JavaScript to perform following operations

  • If inverse is selected and 0 is given in input, alert with "wrong input".
  • If log is selected and non positive no is given in input, alert with "wrong input".
  • Calculate the result of the functions x, 1/x and log(x) for linear, inverse and log functions respectively and show the result on web page.
  • Also convert the form data into JSON, append the result and show the json on web page (Use <pre> tag for code block).

Screenshots
Screenshot 2023-05-24 at 11 31 18
Screenshot 2023-05-24 at 11 31 38

Reference
Convert form data to json: https://stackabuse.com/convert-form-data-to-javascript-object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions