AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Input attribute tabulo4/9/2023 ![]() alert(document.getElementById(formId).length) Still I don't like this solution, but I'm forced to use TABLE structure because of the dataTables jquery plugin. This way, the "target_for_the_form_treatment" should receive POST data as if a form was sent to him (appart from the post = 1, but to implement this solution i would recommand dealing with the trailing '&' of the data_str instead). retrieve field name and value from the DOM the dummy init value (1=1)is just here ĮDIT : complete process with jquery/ajax would be : //init data string The above exemple will work, but it's not really "clean", because it refers to the TR instead of the FORM, AND it requires AJAX. ![]() fields within the TR with the id='tr_id' With an optional data-action attribute on the anchor tag the target url of the POST can be specified.Įxample script $(document).ready(function()) I attach a click handler to a 'update' anchor at each row, that will trigger the collection and 'submit' of the fields on the same row. Use javascript (in this case jQuery) to do the posting of the data, mostly you will do it with javascript, because only one row had to be updated and feedback must be given without refreshing the whole page (if refreshing the whole page, it's no use to go through all these trobules to only post a single row). The answer of is basicly 'the same' as I would go for at this moment.ĭon't use tags at all and prevent 'inappropiate' tag nesting. So basically, open the form at the beginning of the row and close it just after the end of the row. I guess you may have a dynamically produced table, as I do, which is why parsing the table rows is a bit non-obvious for us mortals. Working for me, even if the number of validation errors it produced was a new personal best/worst! No problems seen as a consequence, and I have a fairly heavily styled table. I'm no expert, but putting Īt the end of the row certainly gives the functionality (tested in Firefox, Chrome and IE7-9). ![]() I'd say you can, although it doesn't validate and Firefox will re-arrange the code (so what you see in 'View generated source' when using Web Developer may well surprise). These days I know of many ways to crack this particular nut, but a quick and dirty solution that will validate is to do much the same but use CSS tables for layout, not a regular HTML table. ![]() I wrote the below over ten years ago, when the world was a different place. ![]()
0 Comments
Read More
Leave a Reply. |