I am starting a project that has been managed using a spreadsheet until now but needs to be converted to a mysql/php application. The amount of rows in the spreadsheet has exceeded something that can be easily sorted, filtered and edited.
A particular field has a weak entity that is not worthy of its own field in the database. It concatenates data from other fields in the same database record plus some arbitrary text. I want to display this concatenation in a textarea for each record. The application will display anywhere from 1 to 10 rows on a screen page. Each record is a table. Only the Command syntax is a form element, in this case textarea. All other record data is static text rendered by php. Below is a depiction of the web page and each record.
+------------------+-------------------------------------------------------------------------------+
| Record: | 1 |
| FileName: | This_is_a_file_name.mkv |
| Production Date: | 2010-02-28 |
| Release Date: | 2010-10-01 |
| Project ID: | J0290 |
| Command: | mv /current_location/This_is_a_file_name.mkv \ |
| | /new_location/This_is_a_file_name-J0290-Prod_2010-02-28-Rel_2010-10-01.mkv |
+------------------+-------------------------------------------------------------------------------+
+------------------+-------------------------------------------------------------------------------+
| Record: | 2 |
| FileName: | Another_File_name.mkv |
| Production Date: | 2011-12-20 |
| Release Date: | 2012-03-15 |
| Project ID: | H0500 |
| Command: | mv /current_location/Another_File_name.mkv \ |
| | /new_location/Another_File_name-H0500-Prod_2011-12-20-Rel_2012-03-15.mkv |
+------------------+-------------------------------------------------------------------------------+
In the mark-up, I plan something like
<textarea class="command">
</textarea>
I want to use Javascript on the textarea that renders the Command but am stuck getting started. Javascript is great for working with page and form elements when the DOM object is an id for an id has to be unique. But what about when the elements are a class?
On document ready, I want the javascript to fire and produce the command syntax for each record consecutively and without having to click on each command textarea to fire a javacript to render the command syntax.
Research I have done so far hasn't shown clear examples of gathering all the class objects on a page and traversing through them.
Can someone point me in the right direction for executing this project? Can it be accomplished with vanilla javascript or do I need a library like jQuery? I have a fair amount of experience at server-side php programming. I want this as a challenge to improve client-side programming skills.