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

Task 10: Form Validation and JSON #90

Open
7 tasks
PradyumnaKrishna opened this issue May 24, 2023 · 1 comment
Open
7 tasks

Task 10: Form Validation and JSON #90

PradyumnaKrishna opened this issue May 24, 2023 · 1 comment

Comments

@PradyumnaKrishna
Copy link
Member

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

@PradyumnaKrishna
Copy link
Member Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant