Martin Atkins (mart) wrote in lj_dev,
Martin Atkins

More Laborious Cleaning Work

Lots of places on LiveJournal there are GET forms which don't specify an ACTION attribute. These include the new support filtering feature and the interests browser.

Most browsers, when ACTION is ommitted, will use the current URL as the URL to submit to, which is a reasonable idea. Internet Explorer will, in the case of help.bml in support, submit the form on to, maybe, which would, again, seem like a reasonable idea. It took the URL up to the query string and used that as the default.

Enter Opera. A different browser, with different ideas about what to do when you leave out the required ACTION attribute. Opera submits the form on the URL I indicated before to ... that is, it adds the new form values in addition to the ones that are already there. This also seems like a reasonable idea, since they were already part of the URL which it has elected to use as the default.

I have no idea which of these, if either, is a HTML-compliant action... we don't generally seem to care on LiveJournal anyway for better or worse, so long as it works in as many places as possible.

LiveJournal's querystring parser does some odd stuff when there is more than one of the same variable, which stops the support form thing working correctly in Opera.

The solution to this is simple. action="help.bml" needs to be added to the form tag. This fixes the problem, and makes it work in both IE and Opera. I don't have any other browsers around to test in, but there's probably another one somewhere which does what Opera does.

This would be all well and good if this were the only place on LiveJournal where this is done, but it isn't. I also know of the problem being in the interests section, and I'm sure elsewhere too. This leads to the reasonably laborious task of reading the code of lots of BML documents looking for form tags without action attributes and, hopefully, adding it and submitting a diff. This would be a reasonably simple job for someone with some time to kill. Any takers?


  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded