SaaS CMS has officially launched! Learn more now.

Setting value in Xform posting?

Can I set the value in a Xform field on pageLoad or on submit? I need to add a page value to a hidden field in a Xform and then pass it along with the posted data. /martin
May 10, 2006 13:41
It's possible to set a value for a field when loading a form or when saving form data. You do not even have to have a hidden field for this if you do not want to as it is possible to store additional form data for xforms. Here is an example of how to set form data: private void Page_Init(object sender, System.EventArgs e) { FormControl.BeforeSubmitPostedData +=new SaveFormDataEventHandler(FormControl_BeforeSubmitPostedData); } private void FormControl_BeforeSubmitPostedData(object sender, SaveFormDataEventArgs e) { e.FormData.SetValue("MyCustomField", "SomeValue"); } For more info and examples, please see the alternative xforms user control: See also the new tech note, "Developing with XForms", that was released with the 4.60-documentation:
May 18, 2006 15:14
I'm trying to do this in, but get the following exception message: "Expression must evaluate to a node-set.". Has it changed since last year? Regards, /Patrik
Jun 13, 2007 20:48
Never mind, I was apparently trying to use a number as the key, which wasn't valid :) Regards, /Patrik
Jun 13, 2007 21:36
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.