Just found this out the hard way, and passing it along to save someone else a few hours of debugging.
I was making changes to a form within a db I inherited. I simply wanted to add a radio button and have the form refresh when the radio button selection was changed. I added the radio button (with two values) and selected “Refresh fields on keyword change”. Clicking one of the radio buttons correctly refreshed the page on the web when using Firefox, but using IE (v6) I got the following JavaScript error:
Error: Object doesn’t support this property or method
The problem? There was another field on the form (a dialog list) named “action”. In addition, the db property “Use JavaScript when generating pages” was checked. This adds the JS “_doClick” function at the top of the page, which includes the line
if (h != null)
form.action += h;
Since there’s an “action” field defined on the form, things get a bit confused. Not sure why this works in Firefox, but the only way I found to avoid the problem in IE was to rename the “action” field on the form to something else (and run an agent to fix the existing docs in the db).
Probably best to simply avoid naming fields “action”.
Subject: RE: Never use “action” as a field name on a web form!
I shouldn’t have implied that the elements collection is the only route to the field. You can just as easily use document.getElementsByName(“action”) or give the field an HTML id (on the tab) and use document.getElementById(), and so on. You just can’t use the form.fieldname shortcut we’ve all grown used to.
Subject: RE: Never use “action” as a field name on a web form!
Stan, thanks for your responses. However, the issue isn’t that I’m trying to access the “action” field. The issue is that the “_doClick” function generated by Domino fails (at least in IE 6) when attempting to refresh the form. The failure (“Object doesn’t support this property or method”) occurs on the following line:
if (h != null)
form.action += h; <======= Error In This Line
Aside from turning off the db “Use JavaScript” property, I have no control over this code.
Try this… create a form with a single field on it. Name the field “action” and make it a dialog list (or radio button) with a few choices. Check the “Refresh fields on keyword change” box. Be sure the “Use JavaScript” property is checked on your test db.
Now compose the form on the web (using IE) and change the value in the listbox. In my environment, I get a JavaScript error instead of the page refreshing (note that if I use Firefox the page refreshes correctly).
I don’t know a way around this short of renaming the “action” field to something else.