Forum OpenACS Development: Re: Ad_form DOM error

Collapse
5: Re: Ad_form DOM error (response to 4)
Posted by Gustaf Neumann on
Dear Eduardo,

i have committed a patch to the oacs-head and oacs-5-4 branches that add adds IDs to HTML forms built with the form builder. The IDS have the identical value as the "name" of the FORM. In other words, FORMs have now an ID and a name, both with the same value. Therefore, the exiting javascript parts of openacs expecting a "name" should continue to work, and new code, requiring IDs for FORMs should work as well.

In general, the HTML syntax specification for IDs and names is the same, the only potential conflict happens when the HTML document has already an ID for a different element, which is identical to the FORM ID. For the existing apps i have checked, this does not appear to be a problem. In general, we should define in openacs naming convention for all IDs and names to avoid clashes. This is however a larger issue since it involves CSS as well, when we start to rename IDs, on which some applications might rely. So, keep this in mind, when you use the FORM IDs (or other IDs).

Collapse
6: Re: Ad_form DOM error (response to 5)
Posted by Eduardo Santos on
Hi Gustaf,

You were quite fast on that. I didn't mean to give you some extra work, but as I told you it seemed the right thing to me. You are right when you talk about more than one ID in the same page, but I don't think it should happen. It's something like a "good practice" not doing that, especially when you are using JavaScript in the page, even though we know somebody will do it.

If you need any help in this kind of work, let me know what I can do to help. I don't have commit rights but maybe I can submit a patch for these boring fixes.

Thank you for the good work.