Fórum

How to access value from textboxlist in Firefox

Katarzyna B, modificado 12 Anos atrás.

How to access value from textboxlist in Firefox

New Member Postagens: 18 Data de Entrada: 07/01/12 Postagens Recentes
Hi,

In my form I have a textboxlist whose values (input provided by user) I need to access on server, when the form is submited. Alloy documentation does not say how to do it that's why I tried the solution described below. It works, but not in Firefox, which is obvously a problem. So now I'm looking for any alternative way to access textboxlist values on submission or to solve problem described below.

I have a texboxlist defined like this:
AUI().ready(
		'aui-textboxlist',
		function(A) {
			var users = [ [ 'Joe Bloggs(test@liferay.com)' ],
					[ ' (default@liferay.com)' ],
					[ 'Bruno Admin(bruno@7cogs.com)' ],
					[ 'John Regular(john@7cogs.com)' ],
					[ 'Michelle Writer(michelle@7cogs.com)' ],
					[ 'Richard Editor(richard@7cogs.com)' ] ];
			window.TBL = new A.TextboxList({
				dataSource : users,
				schema : {
					resultFields : [ 'name' ]
				},
				matchKey : 'name',
				typeAhead : true,
				contentBox : '#myAutoComplete'
			});
			TBL.render('#demo');
			TBL.inputNode.focus();
		});


I followed the ideas from this thread and added this code to access the values set by form submission:
}...
			TBL.render('#demo');
			A.one('#_20_fm').on('submit', function(event) {
				alert(TBL.entries.keys.join());
				var node = A.one('#hiddenInput');
				node.attr('value', 'Setting a new value attribute');
				alert(node.attr('value'));
				A.one('#hiddenInput').val(TBL.entries.keys.join());
				alert(TBL.entries.keys.join());
			});
			TBL.inputNode.focus();
		});


This works fine in Chrome, but in Firefox the behaviour is really strange - on form submission I can see expected values in alerts, but the request that's sent to server has the hiddenInput field's value not updated.

Can you suggest any solution? Or maybe some ideas what's causing this behaviour?
Any hints are welcome, as now I'm somehow stuck...
Many thanks for any input emoticon