form.getValues() method not getting value for hidden fields

I have a form with two hidden form fields that contain values to be sent to my server program. When I use the getValues() method to post the form the values of the hidden fields are received as empty.

Here is my form. The “session_no” and “request_id” fields are hidden:

{view:"form", id:"taskform", scroll:true, elements:[ { view:"datepicker", label:"Date", name:"date", id:"date", dateFormat:"%m/%d/%y"}, { view:"text", label:"Ref", name:"reference", id:"reference"}, { view: 'input', label: '', type: 'hidden', name: 'session_no', id: 'session_no', value: 'W4DNNE9DBN9EU1F219DRNDR2W',hidden:true}, { view: 'input', label: '', type: 'hidden', name: 'request_id', id: 'request_id', value: 'MPTASKUPD',hidden:true}, { view:"textarea", label:"Text", name:"Textarea", inputHeight:'300', inputWidth:'400' } ] }

Here is the function I’m using to submit the form:

[code]function saveTask() {
var saveTaskURL = “http://pz.southware.com/cgi-nl/NLNET15.BAT”;
dhx.ajax().sync().post(saveTaskURL, $$(‘taskform’).getValues(), function(text, xml, xhr){

		    if (text.substr(0,2) == "OK") {
		     	$$('taskform').save();
        		alert("Task Saved");  //debug
        		showGrid();
        	};
		});
    	
    };[/code]

And here is the resulting post string as reported by my server program:

Notice that the values of the session_no and the request_id are empty in the post string.

Please tell me how to get the values of the hidden fields included in the post string.

Thank you.

I think I’m having a problem because the two hidden fields in the form are not in the grid data and the grid is bound to the form. Is that likely?

If I bind a form to a grid can I have hidden fields in the form that are not included in the grid? I need to send these fields to my server as part of the url, but the value of the fields is the same for all records in the grid.

I think I’m having a problem because the two hidden fields in the form are not in the grid data >>and the grid is bound to the form. Is that likely?

There is no need to make them visible in the grid, but they must exist in data which is loaded in grid. ( unknown properties will be preserved and used while filling related form )

Actually if you will hidden fields from grid - you can remove them at all.
Form will store all received data, if there will be properties not mapped to the inputs, they will be preserved unchanged, and will be sent to the server side as all other data of form.