Jump to content

incremental number for each table row


Go to solution Solved by mac_gyver,

Recommended Posts

How is a FORM tabular data? Let's not lose sight of where we started. The OP is using a table for LAYOUT/PRESENTATION when he should be using CSS.

 

The OP's form asks for a series of school [names], student [names], and class [names]. That data, once collected, would likely be displayed in a data table as described by NotionCommotion in Reply 11. Of course, the real data wouldn't say Student1, Student2, etc.

 

So if the collected information works as tabular data, why can't the input fields be displayed with an HTML table? Is it because the input fields are probably going to be empty in the beginning? If so, let's say a visitor fills out the form, but they forgot a required field. The form would hopefully be displayed again for the visitor to enter the missing data. The fields now contain data. Shouldn't that be treated as tabular data...assuming the table is formatted to meet accessibility best practices?  :happy-04:

 

 

With all that said, I am fully aware that the code posted by the OP is not accessible.

What you are talking about sounds more like Ajax inline table editing with dynamic table row creation. Of course this can be done if it's what you really want.

 

This is what I believe you are referring to but I dont think this is what the OP is trying to do. 

http://talkerscode.com/webtricks/demo/demo_add-edit-and-delete-rows-from-table-dynamically-using-javascript.php

What I'm referring to can be accomplished with plain HTML and PHP. Basically, a user is presented with a blank form. They fill it out and hit submit. Then PHP processes the submission. If it finds a required field that was left blank, PHP builds the form again and incorporates everything the visitor entered before, along with an error about the missing data.

 

I don't see why those form fields, with or without data, cannot be displayed in an HTML table. As long as the proper coding is added to make it a data table, people with assistive devices will know if a field contains a value or is blank.

 

They also get a bit more information about the fields because of the data table. They will know who many rows and columns the table contains, for example. So if the form has one of those "add more fields" features, the person with a screen reader, for example, could make sure they have enough rows to entering their data.

What I'm referring to can be accomplished with plain HTML and PHP. Basically, a user is presented with a blank form. They fill it out and hit submit. Then PHP processes the submission. If it finds a required field that was left blank, PHP builds the form again and incorporates everything the visitor entered before, along with an error about the missing data

 

All fine and good and as it should be. What I am saying and others would say, is use CSS for the layout you want, not HTML.

 

i.e: <table><tr><td>.....

 

There is nothing more I can say other than that.

Edited by benanamen

And as I said before, this is tabular data. So using an HTML table that's marked up is acceptable. While some may say that you need to use CSS, I'll continue following the advice put forth by the website accessibility community. :-)

Edited by cyberRobot
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.