Hey, I am trying to create a form where in I can input 3 or more values on it, but I do not know where to start I am planning to create a datagrid like in PHP, Guys can you help me? Thank you.

Recommended Answers

All 4 Replies

This is a rather vague question, but I'm going to try to make an effort. What you could possibly do is use ajax/jquery to give the user a choice of how many input fields to display ... rows and columns, while dynamically generating unique identifiers for each one and using those to save data to database.

Hi, ohh is there other means to do it? I do not know ajax or jquery. Just simple javascript only. hmmmm

Member Avatar for diafol

This could be a very complicated or very simple solution - depends what you want to do. You say you want an Excel-type grid. So an confused when you say you are using 3 inputs instead.

If you want to build this from scratch, then I suggest using JS for the main guts of it. I'm not sure that PHP would even come into it unless you're CRUDing data. For a simple implementation, you could get away with building an empty html table with fixed cellsize. You'd only need one textbox (or textarea), which would "shift" to the current cell with e.g. 'click' event. This textarea would read/write as it entered/left the cell. You'd involve PHP at the end with the big SAVE button maybe. Not sure you'd need to Ajax every little action. Nothing stopping you ajaxifying the whole thing, but a bit costly on the old server.

There will be many many third party scripts out there for this sort of thing - the obvious ones are the 'edit-in-place' scripts.

Ahh ok. Thank you for the idea. I'll come back soon for progress. Thank You!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.