-1

I want to know how to create todo list, rather than coding I need the approach

of it, like how to analyse the problem and how to map it to coding? I just want to

how to approach for any sort of real world problems using javascript.

How/what/where start coding?

  • 3
    Any research from your side?.Please share that – brk Feb 16 '16 at 05:07
  • 2
    Don't worry about being downvoted. Your question is not the type that StackOverflow users like (i.e. it is not a specific programming question, rather it is a general "how do I approach this" question). However, when I was starting out I had the same kind of questions. So, you get some downvotes... don't take it personally. Use any info you get, and run with it. – cssyphus Feb 16 '16 at 05:21

1 Answers1

3

Your project will contain a mixture of:
- HTML
- javascript
- PHP
- MySQL (optional)

Things to consider:

(1) Where to store the list? Options include: PHP text file, or MySQL database. Database is best idea and will probably be easiest to code, all things being equal. Of course, if you do not need the To Do Lists available online, you can also choose store the lists in localstorage in each user's browser. Then there is no need for PHP or MySQL, both of which run on the webserver. If you are doing this as an exercise to learn web programming, but you do not have access to a web hosting account, then download xampp and set up a proper web server on your own computer - hint: the HTML files go inside c:\xampp\htdocs, and you see the website by typing localhost (nothing else) in the browser address bar

(2) HTML. You will need two things: (a) display the completed ToDo List, and (b) the ability to add new items to the list.

(3) Display current list. Get the list values from database (or file) and read into an array (an array is like a train where each boxcar is a variable name containing data). Then, loop through the array to create the HTML to display your current list.

(4) After creating HTML for the list, add a bit of HTML (perhaps a button with a label) to allow creating a new list item.

(5) When button pressed, display a form with appropriate fields to allow user to add a new To Do List item. Note that this does not need to be an HTML <form> -- you can use DIVs and input fields, and then use jQuery to read the field values and AJAX to stick the data values into the database.

Helpful simple examples re AJAX are here:

AJAX request callback using jQuery

Community
  • 1
  • 1
cssyphus
  • 31,599
  • 16
  • 79
  • 97