Retrieve value from Html Control

  • 22 June 2004
  • 2 replies
  • 2 views

Badge +1
Hi,

I had create a plan page with a HTML Control (File Field). I want to retrieve the file name from the file field text box...(did it already).
I failed to assign the value to the work flow datafield [fileName].
I was using the k2 Rom source code to do it. but it was failed also.

Any idea?

Thanks.

2 replies

Badge +8
If you are using a K2 datafield on the plan form, the field is 'cleared' when the form is displayed. (for instance, if you are populating the k2 datafield in code using the forms load event, the field will be overwritten by K2 after the load event.

In service pack1, as new event (afterload, i think) was added so that you can populate a k2 datafield in code without having it overwritten.

Otherwise, you need to add a normal text field, assign the value to the text field in the load event and then, on client-side, send the value of the normal text field to the k2 datafield.

Did I understand your problem correctly?
Badge +2
Hi

OK what I would suggest is the following:
1) Make sure the FileField is set to runat="server"
2) Add a K2Textbox and bind it to the datafield you want to use and make it invisible.
3) In the click event of the Plan Button set the value of the FileField control to the text of the invisible K2TextBox.

Hope this helps

Cheers

Reply