Login Register

io bind FF formNode problem

I have joined a project that is written in java/jsp and uses dojo-ajax-0.4.3. There are a number of forms that through javascript events end up adding elements to the form, mostly elements. These forms are processed via a link with an onclick that results in an io-bind call to the backend. In the backend, the elements that were added are not available via a get parameter request. All other elements are there. In the js function that does the io-bind, a getElementById does yield the value of the element so I know that it is there. This is not a problem with IE6 and/or IE7, but with FF 2.0.0.12 the element does not appear to be populated by the formNode option.

I have searched a good bit and do not find any reference to this problem. I know that a typical response may be to upgrade to the latest version of dojo, but there is a lot of use of io-bind in this project and we are in the process of a rewrite but the current set of code will need to be maintained for several months to come and is now subject to FF support as well (only IE6 supported until recently).

Here is the javascript used to call io-bind

alert("Make: " + document.getElementById('tempCboMake').value);
	startProgress();
	document.formSalesInfo.target.value='saveLead'; 	    	
    var bindArgs = {
    	formNode: dojo.byId("formSalesInfo"),
        url: "doILMProcess.jsp",
        load: function(type, data, evt){displayMessage(type, data, evt);stopProgress();},
        error: ilmErrorHandler,
        mimetype: "text/json"
    };
    var req = dojo.io.bind(bindArgs);

Any thoughts would be appreciated.

Steven

Longshot: The form

Longshot: The form processing will only send data from elements that have the "name" attribute. Do the added elements have the "name" attribute?

frankf, Yes, the "name"

frankf,

Yes, the "name" attribute is the same as the "id" attribute. As mentioned, this is not a problem in IE6/7, that is, it works fine when using IE. This element is one that is generated by javascript and I have checked using the DOM Inspector in FF and both the "id" and "name" attributes have the same value. I believe this to be a FF issue, or maybe an IE one that turns out to be what is wanted... I have not tested with any other browsers so I do not know which is the issue, only that it does do what I want in IE and not in FF. All of the elements that are coded into the form and not added by javascript do come across as expected, only the javascript created elements do not.

-Steven

It may be worthwhile to take

It may be worthwhile to take a copy of one of the test files, , keeping it in the tests directory, e.g.,

http://download.dojotoolkit.org/release-0.4.3/dojo-0.4.3-src/tests/io/te...

and add a button/function to it that adds an element to the form and then you do its submit and see if it shows the same problem. If not, it may help you find where the problem is.